当前位置:网站首页>How many threads does LabVIEW allocate?

How many threads does LabVIEW allocate?

2022-08-10 22:40:00 LabVIEW development

How many threads does LabVIEW allocate?

Answer: Thread allocation in LabVIEW is dynamic, and there is no single answer to this question.LabVIEW allocates many different types of threads:

A UI thread for screen refresh and keyboard and mouse input.This thread is also used for the execution of certain VIs, such as property nodes, unsafe threads, and DLLs.

A pair of timed threads, used internally by LabVIEW.(Windows95/NT allocates additional threads for internal use)

20 threads of execution (perCPU). See below for more information.

On Windows 95/NT, threads are dynamically assigned to operations that use an ActiveX client to control LabVIEW.

So, for a single core system, 23 or 24 threads are allocated at the start of the application.If you use the ActiveX client, more threads are allocated when running the VI.

Notes on execution threads:

LabVIEW has five "execution systems", and each execution system assigns threads to four different levels.So there are 20 threads in total, and no UI thread is included, which is also used for execution.Threads of execution are allocated based on how many processors the system has.So a dual-core processor computer would have 40 threads of execution plus the other threads mentioned.

Notes on priority:

Subroutine VIs always use the call execution system.Therefore it is the most efficient in the same execution system.There is no standard "background priority" assigned to threads.VIs running at this priority use the higher-priority thread when no other threads are running.

Advanced users can adjust some of the threads assigned to the system by running the following VI: vi.lib\Utility\sysinfo.llb\threadconfig.vi.

Edit

Add image comment, no more than 140 characters (optional)

Why is multithreading turned off in LabVIEW?

There are two reasons to turn off multithreading:

On an older/slower computer

The VI crashes inexplicably

Multithreading can cause LabVIEW to run slower on older computers because of its limited resources.In this case, turning off multithreading can improve the performance of LabVIEW and other running applications.

Today, multithreading is mostly turned off for debugging VIs that crash for no apparent reason.VIs that use ActiveX functions or dlls that are incorrectly identified as thread-safe may crash because the ActiveX function or dll corrupted the computer's memory.If turning off multithreading makes the VI stable, you can focus on these parts of the code.If you have access to the source code of the dll or ActiveX component, you can correct it yourself.If the dll or ActiveX component is from a third party, you can set the dll to run in the user interface thread, but the ActiveX component may require LabVIEW not to revert to multithreaded mode.

In LabVIEW 8.2 or later, the Performance and Disk tab in the Options dialog box no longer exists.To turn off multithreading, you must manually add an entry to the LabVIEW.ini file.Add ESys.StdNParllel=0 to the .ini file to disable multithreading in LabVIEW.

LabVIEW, LabVIEW development, LabVIEW programming, LabVIEW programs, and related project questions, please contact us.

The examples and materials mentioned above are in the attachments in word, which can be clicked to download.

How many threads are allocated by LabVIEW - Beijing Hanwen Netstar Technology Co., Ltd. (bjcyck.com)

原网站

版权声明
本文为[LabVIEW development]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/222/202208102202489614.html