LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do queues require semaphores (i.e. are queue operations atomic?)

Solved!
Go to solution

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

0 Kudos
Message 1 of 8
(2,878 Views)
Solution
Accepted by topic author chassan

No, semaphores normally not required.

0 Kudos
Message 2 of 8
(2,869 Views)

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.

0 Kudos
Message 3 of 8
(2,862 Views)

This has been previously discussed here.

0 Kudos
Message 4 of 8
(2,849 Views)

Note that under the hood, semaphores are currently implemented using queues.

0 Kudos
Message 5 of 8
(2,801 Views)

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 

0 Kudos
Message 6 of 8
(2,751 Views)

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.

0 Kudos
Message 7 of 8
(2,732 Views)

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

0 Kudos
Message 8 of 8
(2,688 Views)