Add thread-safe priority queue with arbitrary priorities using flat combining
authorMaged Michael <magedmichael@fb.com>
Thu, 4 May 2017 02:57:21 +0000 (19:57 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 4 May 2017 03:08:57 +0000 (20:08 -0700)
commit223ef4eb26a7972b3cfa7bab945f7b4dc5d1000b
tree08962a87a823ba16156b84d87be126752321f66c
parent5947e77818dae0a0409bbe0d577464f7b2a7a687
Add thread-safe priority queue with arbitrary priorities using flat combining

Summary: This template uses flat combining and takes any sequential priority queue implementation that supports the `std::priority_queue` interface (`empty()`, `size()`, `push()`, `top()`, `pop()`) and any lock that meets the standard //Lockable// requirements to implement a thread-safe priority queue that supports arbitrary priorities. The template supports both unbounded and bounded size, and blocking, non-blocking, and timed variants of push, pop, and peek operations.

Reviewed By: djwatson

Differential Revision: D4873602

fbshipit-source-id: 96e1548b4f7427ecd2ee2ead7a19993df4441b33
folly/experimental/FlatCombiningPriorityQueue.h [new file with mode: 0644]
folly/experimental/test/FlatCombiningPriorityQueueTest.cpp [new file with mode: 0644]