From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

producer consumer events with notifiers

Solved!
Go to solution

Yes, it depends on the loop.  If the loop has reason to be a full message handler then it is probably wise to add a "shutdown" command.  But a small, simple, low-level loop with limited responsibilities shouldn't sacrifice its simplicity just to support a shutdown message.  

 

For example, if I had a TCP server, I would likely have a loop that just waited for incoming data on the TCP connection, interpreted it as messages, and put the messages on a queue.  Establishing, reestablishing, or closing the connection is not its responsibility.  If the connection dies, it shuts down and passes the error out.  Higher-level code can restart this loop if it decides it.  Adding a message queue, and introducing polling to monitor this queue, is needless complexity.

 

-- James

0 Kudos
Message 11 of 11
(246 Views)