Yes, You Have Been Writing SPSC Queues Wrong
vitorian.com
Yes, You Have Been Writing SPSC Queues Wrong
1–10 of 35 posts
Re: Yes, You Have Been Writing SPSC Queues Wrong
#2[EDIT:] To clarify for those who didn't (couldn't?) read TFA's first sentence, it specifically invokes "I've been writing ring buffers wrong all these years" [0], recently featured on HN.
[0] https://www.snellman.net/blog/archive/2016-12-13-ring-buffer...
Re: Yes, You Have Been Writing SPSC Queues Wrong
#3Why is push() checking for overlap? I thought not caring about that was the point of a ring buffer? [EDIT:] To clarify for those who didn't (couldn't?) read TFA's first sentence, it specifically invokes "I've been writing ring buffers wrong all these years" [0], recently featured on HN. [0] https://www.snellman.net/blog/archive/2016-12-13-ring-buffer...
Re: Yes, You Have Been Writing SPSC Queues Wrong
#4Why is push() checking for overlap? I thought not caring about that was the point of a ring buffer? [EDIT:] To clarify for those who didn't (couldn't?) read TFA's first sentence, it specifically invokes "I've been writing ring buffers wrong all these years" [0], recently featured on HN. [0] https://www.snellman.net/blog/archive/2016-12-13-ring-buffer...
I can't read the site because it's blocked for me, but isn't a ring-buffer a different class of data-structure than a queue? AIUI, queues are for non-lossy FIFO behavior.
Re: Yes, You Have Been Writing SPSC Queues Wrong
#5Why is push() checking for overlap? I thought not caring about that was the point of a ring buffer? [EDIT:] To clarify for those who didn't (couldn't?) read TFA's first sentence, it specifically invokes "I've been writing ring buffers wrong all these years" [0], recently featured on HN. [0] https://www.snellman.net/blog/archive/2016-12-13-ring-buffer...
Re: Yes, You Have Been Writing SPSC Queues Wrong
#6Why is push() checking for overlap? I thought not caring about that was the point of a ring buffer? [EDIT:] To clarify for those who didn't (couldn't?) read TFA's first sentence, it specifically invokes "I've been writing ring buffers wrong all these years" [0], recently featured on HN. [0] https://www.snellman.net/blog/archive/2016-12-13-ring-buffer...
Re: Yes, You Have Been Writing SPSC Queues Wrong
#7Re: Yes, You Have Been Writing SPSC Queues Wrong
#8I'm curious what you think the problems are that unbounded indices causes? Unsigned overflow is well defined in C++, so I don't see the problem here. AFAIK, the only issue would be with requiring power of 2 sizes.
Re: Yes, You Have Been Writing SPSC Queues Wrong
#9Why is push() checking for overlap? I thought not caring about that was the point of a ring buffer? [EDIT:] To clarify for those who didn't (couldn't?) read TFA's first sentence, it specifically invokes "I've been writing ring buffers wrong all these years" [0], recently featured on HN. [0] https://www.snellman.net/blog/archive/2016-12-13-ring-buffer...
I can't read the site because it's blocked for me, but isn't a ring-buffer a different class of data-structure than a queue? AIUI, queues are for non-lossy FIFO behavior.
Re: Yes, You Have Been Writing SPSC Queues Wrong
#10Why is push() checking for overlap? I thought not caring about that was the point of a ring buffer? [EDIT:] To clarify for those who didn't (couldn't?) read TFA's first sentence, it specifically invokes "I've been writing ring buffers wrong all these years" [0], recently featured on HN. [0] https://www.snellman.net/blog/archive/2016-12-13-ring-buffer...
Depends how you use it. For buffering realtime data if latency is of chief concern then by all means, discard the old stuff. If the desired behavior is to block when the queue is full, then you need to check for an overlap.