In the push(task) in “Going lock-free…” section, there seems to be a reference to a t that is not defined anywhere?
Also, I’m not sure I understand how the push is expected to work without overwriting another concurrent push; shouldn’t the tail be incremented first, and only then the task stored? or is there something else I’m missing? But maybe things will clear up once the issue of the missing t is fixed?edit: Ok, I get this part now, I forgot that this is a thread-local queue, where only Single Producer can add things. So no races between pushes.
Nice catch. Looks like the post is full of grammatical errors. Also yes the t is tail and can be loaded & stored to without rmw synchronization given it’s single producer (SPMC).
In the
push(task)
in “Going lock-free…” section, there seems to be a reference to at
that is not defined anywhere?Also, I’m not sure I understand how theedit: Ok, I get this part now, I forgot that this is a thread-local queue, where only Single Producer can add things. So no races betweenpush
is expected to work without overwriting another concurrentpush
; shouldn’t thetail
be incremented first, and only then thetask
stored? or is there something else I’m missing? But maybe things will clear up once the issue of the missingt
is fixed?push
es.edit 2: As to the missing
t
, based on a fragment of the linked source repository, I assumet
is intended to be basically equivalent totail
. Given that, again, only the Single Producer will ever write to it.Nice catch. Looks like the post is full of grammatical errors. Also yes the t is tail and can be loaded & stored to without rmw synchronization given it’s single producer (SPMC).