|
Vince's CSV Parser
|
A std::deque wrapper which allows multiple read and write threads to concurrently access it along with providing read threads the ability to wait for the deque to become populated. More...
#include <thread_safe_deque.hpp>
Public Member Functions | |
| ThreadSafeDeque (size_t notify_size=100) | |
| ThreadSafeDeque (const ThreadSafeDeque &other) | |
| ThreadSafeDeque (const std::deque< T > &source) | |
| bool | empty () const noexcept |
| T & | front () noexcept |
| T & | operator[] (size_t n) |
| NOTE: operator[] is not synchronized. | |
| void | push_back (T &&item) |
| T | pop_front () noexcept |
| bool | is_waitable () const noexcept |
| Returns true if a thread is actively pushing items to this deque. | |
| void | wait () |
| size_t | size () const noexcept |
| std::deque< T >::iterator | begin () noexcept |
| std::deque< T >::iterator | end () noexcept |
| void | notify_all () |
| Tell listeners that this deque is actively being pushed to. | |
| void | kill_all () |
A std::deque wrapper which allows multiple read and write threads to concurrently access it along with providing read threads the ability to wait for the deque to become populated.
Concurrency strategy: writer-side mutations (push_back/pop_front) are locked; hot-path flags (empty/is_waitable) are atomic; operator[] and iterators are not synchronized and must not run concurrently with writers.
Definition at line 29 of file thread_safe_deque.hpp.
|
inline |
Definition at line 31 of file thread_safe_deque.hpp.
|
inline |
Definition at line 33 of file thread_safe_deque.hpp.
|
inline |
Definition at line 39 of file thread_safe_deque.hpp.
|
inlinenoexcept |
Definition at line 104 of file thread_safe_deque.hpp.
|
inlinenoexcept |
Definition at line 44 of file thread_safe_deque.hpp.
|
inlinenoexcept |
Definition at line 108 of file thread_safe_deque.hpp.
|
inlinenoexcept |
Definition at line 48 of file thread_safe_deque.hpp.
|
inlinenoexcept |
Returns true if a thread is actively pushing items to this deque.
Definition at line 85 of file thread_safe_deque.hpp.
|
inline |
Definition at line 119 of file thread_safe_deque.hpp.
|
inline |
Tell listeners that this deque is actively being pushed to.
Definition at line 113 of file thread_safe_deque.hpp.
|
inline |
NOTE: operator[] is not synchronized.
Only call when no concurrent push_back/pop_front can occur. std::deque can reallocate its internal map on push_back, which makes concurrent operator[] access undefined behavior.
Definition at line 58 of file thread_safe_deque.hpp.
|
inlinenoexcept |
Definition at line 72 of file thread_safe_deque.hpp.
Definition at line 62 of file thread_safe_deque.hpp.
|
inlinenoexcept |
Definition at line 99 of file thread_safe_deque.hpp.
|
inline |
Definition at line 89 of file thread_safe_deque.hpp.