ocaml-multicore / picos

Interoperable effects based concurrency
https://ocaml-multicore.github.io/picos/doc/picos/index.html
ISC License
86 stars 3 forks source link

Try to avoid contention on back of the queue #126

Closed polytypic closed 4 months ago

polytypic commented 5 months ago

When moving elements from the tail of the queue to the head, if there is more than one element on the tail, then leave the topmost (last pushed) element on the tail and don't update the tail pointer. This reduces contention between producers and the consumer.