LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do I need a semaphore to control adding elements to a queue?

Hello,
 
I am developing a GUI which has several sub-GUIs running concurrently.  I would like to be able to have all GUIs record to the same log file.  To do this I am considering using a queue so that each sub-gui can queue log messages while one VI will record them to the log file as they are received.  Will I be able to enqueue messages from various sources without using a semaphore?  (Will something bad happen if two VIs try to write to enqueue an element at the same time)?
 
Thanks!
Jorge
0 Kudos
Message 1 of 4
(2,312 Views)
There is no need to use a semaphore or any other technique to protect the access to the Enqueue Element function.
0 Kudos
Message 2 of 4
(2,296 Views)

Thanks!

 

0 Kudos
Message 3 of 4
(2,286 Views)
Also remember that elements are typically dequeued in the order they were entered into the queue.  Not from where it was entered.
It is usually a FIFO.  It doesn't matter which sub-vi or loop it came from.
 
RayR
0 Kudos
Message 4 of 4
(2,267 Views)