paulross/skiplist

Provide producer/consumer APIs for the C++ SkipList

paulross opened this issue · 0 comments

The C++ thread-safe SkipList could be used as producer/consumer priority queue. The producer API already exists with insert(). A consume API could be a (blocking) call to, say, pop_front() or pop_back() that simultaneously checks for a non-empty SkipList and removes and returns front/back object.

The API would be something like int pop_back(T &value). If this returns 0 there is nothing to pop and value is untouched. If this returns 1 then value is the value removed from the back. Similarly for pop_front.