09-10-2010 09:25 AM
Hello,
Do queue functions require the use of semaphores to prevent mutliple vis from trying to access them simultaneously, or are the queue operations atomic, thereby eliminating the need for semaphores?
Thanks,
Chris
Solved! Go to Solution.
09-10-2010 09:39 AM
No, semaphores normally not required.
09-10-2010 09:51 AM
If you are worried about accessing the same queue in different spots, does this imply you are trying to send the same data to multiple different sections of code? If so, you should consider notifiers instead. Otherwise, if subVIs are operating in parallel, whichever executes first will get the data from the queue, the other subVIs will not.
09-10-2010 10:37 AM - edited 09-10-2010 10:37 AM
This has been previously discussed here.
09-13-2010 07:35 AM
Note that under the hood, semaphores are currently implemented using queues.
09-17-2010 06:53 AM
Hello for(imstuck),
Actually, I am actually using the queue to allow multiple different sections of code to report their statuses to one piece of code that cases out the statuses; like a multiplexer.
Would a notifier work this way?
At any rate, I've tested it out a bit with queues, and it seems to work well.
Thanks,
Chris Hassan
09-17-2010 09:46 AM
The queue is actually the best way to do this. Notifiers are used for broadcast situations (one source to many listeners). Queues are appropriate of many sources and one listener.
09-20-2010 07:38 AM
Hi DFGray,
Thanks for the information. Your statement reflects what I thought to be true, but some company in my way-of-thinking is always comforting (whether we're actually right or wrong!).
Best Regards,
Chris