01-31-2008 11:08 AM
02-01-2008 12:11 PM
03-28-2008 10:09 AM
Just to have a complete thread on this:
The final answer is LabVIEW correctly preempts even when using a DLL. The issue
came about because when one loop spools up to infinite usage the UI thread WILL
be starved which is why my example code (see higher in thread) appears to
demonstrate stalling of execution.
However, LabVIEW is correctly executing the higher priority loop just the UI
thread isn't updating the indicator because the remaining 100% of the CPU is
being used.
Thanks NI for the great support on this issue though.
I will point out that in a preemptive multithreaded environment like LVRT
having threads which you CANNOT affect the priority of but are still important
breaks part of the preemptive multithreaded nature of the system. The two
examples I have found of this are: 1) the UI thread 2) A little
keepalive() thread that pops up the "PXI stopped responding" dialog
on the PC host.
The end effect of this is that IF you use 100% of the CPU on a LVRT system you
will 1) lose UI functionality (if you had an abort button this could be bad) 2)
Lose UI functionality on your host because the "PXI Stopped
responding" dialog box does not allow you to adjust any other properties
in LabVIEW.
To avoid using 100% of a CPU you must "yield" some time when you're
doing something very busy - this behavior is like a cooperative multithreaded
operating system yet we know LVRT (and PharLap) are preemptive at least by
design.
I propose NI give user access to the "quiet" threads on a LVRT system
so that we can at least adjust their priorities and avoid this preemptive, partially
cooperative, multithreaded OS issue.
-Alex