11-17-2010 02:53 AM
I am newbie in LabwindowsI know multi thread means multi-tasking. But I really do not know practically what part of the of the program to be threaded.
Suppose I want to build a User interface with Labwindows for seeing the data(input/output, parameters, variables. flags) of a microprocessor of an embedded system, and edit variable and parameters and send it to the microprocessor and update value again to be shown in the user interface. Then does it need to be multi-threaded and what part of the program to be threaded and why and what are the criteria. How timing to be calculated for the entire project to considering the multi thread.
If anybody please explain, it will be great help.
Thank you.
11-17-2010 03:33 AM
Multithreading is a powerful addition to applications, as it permits to divide the program into separate activities that can run independent from one each other. Nevertheless, it is an advanced technique that requires a good programming knowledge to be implemented in a proper way. If you are new to CVI I personally suggest not to approach multithreading among the first things; you should go through single-threaded programming and use of timers and asyncronous timers before this, in order to achieve a good skill on fundamental instruments CVI offers before switching to a multithreaded framework.
In case you want to approach multithreading programming, CVI comes with a good application note which you can find useful to understand some concepts of this technique and how they are implemented in CVI: the document is called MultithreadingOverview.pdf and is located in "bin" subfolder in your CVI installation.
11-17-2010 12:34 PM
Hi Roberto,
Thank you for your reply and advice. I already read that document. But still if you can really a little explain me regarding in my case that would be great.
11-19-2010 10:25 AM
The easiest way to get started with, and see the benefits of multi-threading in CVI is to build and play with the async timer example in the sample projects directory.
You run your user interface in the main program thread and do you timing critical work in the async timer thread. Simple, clean, and effective.
Back in the days of CVI 4 multi-threading was usually more trouble than it was worth, but now with multi-core processors common, its really the only way to go.