|
libgrape-lite
A C++ library for parallel graph processing
|
A concurrent queue guarded by a spinlock and can be accessed by multi-producers and multi-consumers simultaneously. More...
#include <concurrent_queue.h>
Public Member Functions | |
| void | Put (const T &item) |
| Put an entity into this queue. | |
| void | Put (T &&item) |
| Put an entity into this queue. | |
| bool | Get (T &item) |
| Get an entity from this queue. | |
| void | Clear () |
Private Attributes | |
| std::deque< T > | queue_ |
| SpinLock | lock_ |
A concurrent queue guarded by a spinlock and can be accessed by multi-producers and multi-consumers simultaneously.
| T | Type of entities in the queue. |
|
inline |
Get an entity from this queue.
This function won't be blocked.
| item | Reference of an entity to hold the got data. |
|
inline |
Put an entity into this queue.
This function won't be blocked.
| item | The entity to be put. |
|
inline |
Put an entity into this queue.
This function won't be blocked.
| item | The entity to be put. |