Closed smarsching closed 7 years ago
You are right, the comment is outdated and wrong. If I am not mistaken it has to be an spsc queue now. The scheme for queue overflow has changed so an extra buffer is used, and the read operation has to compare the extra buffer and the queue without popping the first element from the queue. This "peek" is only possible with an spsc queue.
I have made some changes to the comment (and also some other comments which I believe were outdated). @killenb Could you review my changes please and have a look whether the comments are now clearer?
@smarsching Thanks for correcting the comments. I forgot to update them when changing the code. I just added one detail explaining why we have to use an spsc_queue (an mpmc queue would still be preferred but is not possible due to technical restrictions).
In
ProcessArray.h
we have a comment that says:Funnily, this comment is right above the declaration of
_fullBufferQueue
, which is anspsc_queue
. I actually think that this comment is not valid any longer, because we do not consume elements in the sending thread any longer.This has to be verified and if true, the comment should be modified to say that we can use an
spsc_queue
because we do not consume elements in the sending thread.