mxnet
|
Cocurrent blocking queue. More...
#include <concurrency.h>
Public Member Functions | |
ConcurrentBlockingQueue () | |
~ConcurrentBlockingQueue ()=default | |
template<typename E > | |
void | Push (E &&e, int priority=0) |
Push element to the end of the queue. More... | |
template<typename E > | |
void | PushFront (E &&e, int priority=0) |
Push element to the front of the queue. Only works for FIFO queue. For priority queue it is the same as Push. More... | |
bool | Pop (T *rv) |
Pop element from the queue. More... | |
void | SignalForKill () |
Signal the queue for destruction. More... | |
size_t | Size () |
Get the size of the queue. More... | |
Cocurrent blocking queue.
dmlc::ConcurrentBlockingQueue< T, type >::ConcurrentBlockingQueue | ( | ) |
|
default |
bool dmlc::ConcurrentBlockingQueue< T, type >::Pop | ( | T * | rv | ) |
Pop element from the queue.
rv | Element popped. |
The element will be copied or moved into the object passed in.
void dmlc::ConcurrentBlockingQueue< T, type >::Push | ( | E && | e, |
int | priority = 0 |
||
) |
Push element to the end of the queue.
e | Element to push into. |
priority | the priority of the element, only used for priority queue. The higher the priority is, the better. |
E | the element type |
It will copy or move the element into the queue, depending on the type of the parameter.
void dmlc::ConcurrentBlockingQueue< T, type >::PushFront | ( | E && | e, |
int | priority = 0 |
||
) |
Push element to the front of the queue. Only works for FIFO queue. For priority queue it is the same as Push.
e | Element to push into. |
priority | the priority of the element, only used for priority queue. The higher the priority is, the better. |
E | the element type |
It will copy or move the element into the queue, depending on the type of the parameter.
void dmlc::ConcurrentBlockingQueue< T, type >::SignalForKill | ( | ) |
Signal the queue for destruction.
After calling this method, all blocking pop call to the queue will return false.
size_t dmlc::ConcurrentBlockingQueue< T, type >::Size | ( | ) |
Get the size of the queue.