template<typename T>
class torch::data::detail::Queue< T >
A basic locked, blocking MPMC queue.
Every push
and pop
is guarded by a mutex. A condition variable is used to communicate insertion of new elements, such that waiting threads will be woken up if they are currently waiting inside a call to pop()
.
Note that this data structure is written specifically for use with the DataLoader
. Its behavior is tailored to this use case and may not be applicable to more general uses.
Definition at line 27 of file queue.h.