03-11-2008 11:59 AM
03-11-2008 12:27 PM
Another question: Does threading affect this as well? Do I have to put each instance of the analysis engine in a different thread, or is making them reentrant sufficient?
Thanks,
Bruce
03-11-2008 02:57 PM
03-11-2008 03:10 PM
03-11-2008 10:45 PM
Jeff,
Changing the NI routines to reentrant solved the bottleneck for all but one of my test routines. Now each time I add another analysis engine, the number of possible tests increase proportionally until I hit 100% CPU usage, which is exactly what I wanted. I found for most of the routines the ideal number of engines is 3. For one, the total number of possible tests actually decreased significantly when I went to 4. I think it is best to reserve one core for other processes, such as screen updates, file IO, etc. so I will stick with 3 analysis engines.
For one test, the number of possible tests decreased each time I added an analysis engine. I think one or more of the NI routines can't be made reentrant, but I haven't figured out all the details yet. It looks like IMAQ Extract and IMAQ Particle Analysis may have conflicts. When I make them both non-reentrant, the number of possible tests remains constant as I increase the number of analysis engines. I noticed that Extract may be conflicting with another test since I use it in both. The strange thing is one test is using grayscale images, and the other is using color images, so it doesn't seem like they would conflict anyway.
Any thoughts on either of these routines and if they can be made reentrant?
Thanks,
Bruce
03-12-2008 05:52 AM
03-12-2008 10:54 AM
03-12-2008 11:03 AM
To be clear - it is completely safe to set any Vision VI to reentrant.
03-12-2008 11:11 AM
Hi Intaris,
I can assure you that since IMAQ Vision 5.0 all of the IMAQ Vision VIs have been designed to be set as reentrant. When I led the redesign for that release, we put a special emphasis on making sure the algorithms were multithread safe. There is, of course, the possibility of a bug that caused an issue. I am unaware of any such bug, but I haven't worked in the IMAQ group for quite a few years now, so one may have surfaced that I didn't hear about.
-Jeff
03-12-2008 11:13 AM