Using two parallel loops to write to and read from the same variable, or trying to access a Network Shared Varible while a value is being written to it, can cause a race condition.
Queues implemented in a Producer/Consumer architecture are most commonly used to avoid data starvation or data overflow. Using a Producer/Consumer architecture provides a synchronization advantage because the Consumer loop only executes when there is data available in the queue.Another alternative is to use Semaphores to lock the variable resource while you write to it.
Thank you for your feedback.
You changed your response to Not Helpful
You changed your response to Helpful
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.