Solution
LabVIEW uses a multithreaded execution system that allows VIs and nodes to run concurrently across multiple threads. When calling external code through the Call Library Function Node, LabVIEW provides options to control how the function executes within its threading model.
By default, external calls are executed in the User Interface (UI) thread, which is shared with front panel updates and other UI-related tasks. This can lead to performance bottlenecks, especially in applications that require frequent or long-running DLL calls.
LabVIEW supports executing DLL calls in any available thread, which allows the operating system and LabVIEW’s execution engine to distribute the workload across multiple cores. This is particularly beneficial in multicore systems, where parallel execution can significantly improve throughput and responsiveness.
If the external DLL is thread-safe—meaning it can safely handle concurrent calls from multiple threads—you can improve performance by allowing LabVIEW to execute the DLL call in any available thread. You can do this by following the steps below:
- Locate the Call Library Function Node in your VI.
- Right-click the node and select Configure... to open the configuration dialog.
- In the dialog box, locate the Thread setting.
- Change the option to Run in any thread.

- Click OK to apply the changes.
This change enables LabVIEW to use its multithreaded execution engine, allowing DLL calls to run in parallel with other operations and freeing up the UI thread for user interface tasks.
Considerations
- Only apply the “Run in any thread” setting if the DLL is confirmed to be thread-safe. If the DLL is not thread-safe, executing it in multiple threads may lead to instability, unexpected behavior, or data corruption.
- To verify whether a DLL is thread-safe, consult the DLL documentation provided by the vendor or developer, contact the vendor directly if documentation is unclear or unavailable.
- If you have access to the source code, the resource Configuring the Call Library Function Node provides recommendations on how to assess if the code is thread-safe.
- Use LabVIEW’s Performance Profiler or LabVIEW Desktop Execution Trace Toolkit Download to measure the impact of this change.