Commit 40a62d63 authored by Maged Michael's avatar Maged Michael Committed by Facebook Github Bot

UnboundedQueue: Make linking next, advancing tail, and advancing head wait-free

Summary:
Avoid spin-waiting for threads that may be descheduled by making steps that used to require waiting for action by a specific thread wait-free. The changed steps are:
- Allocating and linking the next segment
- Advancing tail to the next segment
- Advancing head to the next segment

For SPSC, the consumer still must wait for the producer to advance tail before it advances head.

Reviewed By: djwatson

Differential Revision: D8124279

fbshipit-source-id: 4dc9b2c1f333a71e7283175e0f9c4ab2eaeb7549
parent 1df0ebca
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment