You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an operation which involves a single producer thread, and guaranteed only a single consumer thread accessing the queue concurrently. The rub is that the consumer could theoretically change pid numbers, ie be a different thread. Does this still count as SPSC or do I have to use the multiple thread version.
The text was updated successfully, but these errors were encountered:
That's a perfectly valid use of the queue, it still counts as single-consumer. However, you need to be careful to ensure that the memory effects from the first thread are fully seen by the second thread when the hand-off is made (i.e. make use of memory barriers (acquire-release) or a higher-level synchronization primitive like a mutex).
I have an operation which involves a single producer thread, and guaranteed only a single consumer thread accessing the queue concurrently. The rub is that the consumer could theoretically change pid numbers, ie be a different thread. Does this still count as SPSC or do I have to use the multiple thread version.
The text was updated successfully, but these errors were encountered: