From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-03-2009 02:53 AM
Hello,
I'm developping a multithreaded LabVIEW application for Windows.
Typically my application has several threads with a part of them being
cyclically called (timed loop with 100 ms or 500ms or 1s period).
One of the cyclical thread which has a time consuming treatment to
execute seems to be suspended roughly every 15ms. I supposed this is
either a suspension generated by LabVIEW or by the Windows
multithreading mechanism.
Can this chareteristic be tuned (either by a parameter in LabVIEW or in Windows) and how ?
Thank you by advance for your answers.
--
jihef
03-03-2009 06:11 AM
I thought I knew how to shut that off in LV 5 but I can't find tht setting anymore. Anyone else know where the "Run with multiple threads" settings is at?
I'd suspect your time consuming operation is allocating memory durring the delays.
Try using the profiler to figure out if why it is taking more time than expected.
Ben
03-04-2009 04:39 AM - edited 03-04-2009 04:40 AM
Hi,
Labview is optimised to multithread and hyperthreading. I advise you to read this:
Multitasking, Multithreading, and Multiprocessing
Maybe you have to make some optimisation in your code, think to create parallel loop.
Cordialement,
Aurélien J.
National Instruments France
03-04-2009 05:58 AM - edited 03-04-2009 06:04 AM
Aurelien,
Where do I find the set-up page tht used to be called "Performance and Disk" in LV 7.1 and prior but now seems to be missing?
Where do we go to shut off multi-threading?
I want to know this because I support old apps developed before multi-threading was invented.
Ben wrote:I thought I knew how to shut that off in LV 5 but I can't find tht setting anymore. Anyone else know where the "Run with multiple threads" settings is at?
...
Ben
IN LV 7.1 that option is available under Performance and Disks. When set and after closing LV it writes a token to the LV ini file
ESys.StdNParallel=0
I'd guess that is something like "ExecutionSystem.StandardNumberofParallel" .
Placing that line in the LV ini file may still work to shut-off multi-threading.
Ben
03-04-2009 08:06 AM
Thank you Ben. I have invistigated with the profiler and I'm afraid I have a made "classical" mistake in the design of my application.
I'm using an array (1500 elements) of clusters to memorize the caharacteteritics of signals coming from I/O boards or from OPC servers.
In order to be shared by the different threads this array is a global... and it seems to be the main cause of the time consuming operations.
To solve this problem, perhaps a good solution would be to replace the use of the global array by a functional global.
I you have any advice on the subject you're welcome!
Thank you.
--
jihef
03-04-2009 08:27 AM
jihef wrote:Thank you Ben. I have invistigated with the profiler and I'm afraid I have a made "classical" mistake in the design of my application.
I'm using an array (1500 elements) of clusters to memorize the caharacteteritics of signals coming from I/O boards or from OPC servers.
In order to be shared by the different threads this array is a global... and it seems to be the main cause of the time consuming operations.
To solve this problem, perhaps a good solution would be to replace the use of the global array by a functional global.
I you have any advice on the subject you're welcome!
Thank you.
--
jihef
I will not (in this thread) state that globals are evil! But I don't like them.
I wrote a Nugget on Action Engines (Functional Global) that can be found here.
Arrays in LV require contiguous memory blocks. If you have an app that is memory demanding, then passing data using queues may be helpful since each "update" can use a seperate smaller buffer.
So depending on what you are doing I think your idea to go with an AE is valid.
Have fun,
Ben