Dynamic Bounded Queue
authorMaged Michael <magedmichael@fb.com>
Thu, 14 Dec 2017 18:33:06 +0000 (10:33 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 14 Dec 2017 18:39:17 +0000 (10:39 -0800)
commit17c08956e0c46684e3a3a9d3b5e9bc733a09c0ea
tree73941076186ac75faa692902dd665588b699e17a
parentd5b67c256c7423d74f4794d7fe421ed239807be4
Dynamic Bounded Queue

Summary:
DynamicBoundedQueue supports:
- Dynamic memory usage that grows and shrink in proportion to the number of elements in the queue.
- Adjustable capacity that helps throttle pathological cases of producer-consumer imbalance that may lead to excessive memory usage.
- The adjustable capacity can also help prevent deadlock by allowing users to temporarily increase capacity substantially to guarantee accommodating producer requests that cannot wait.
- SPSC, SPMC, MPSC, MPMC variants.
- Blocking and spinning-only variants.
- Inter-operable non-waiting, timed until, timed for, and waiting variants of producer and consumer operations.
- Optional variable element weights.

Reviewed By: djwatson

Differential Revision: D6462123

fbshipit-source-id: 5c7a7d88c3fa273211702af9ff78f6302afd2276
folly/concurrency/DynamicBoundedQueue.h [new file with mode: 0644]
folly/concurrency/test/DynamicBoundedQueueTest.cpp [new file with mode: 0644]