Developer documentation
Version 3.0.3-105-gd3941f44
thread_queue.h File Reference
#include <stack>
#include <condition_variable>
#include "exception.h"
#include "memory.h"
#include "thread.h"

Go to the source code of this file.

Classes

class  MR::Thread::Queue< T >
 A first-in first-out thread-safe item queue. More...
 
class  MR::Thread::Queue< T >::Writer
 This class is used to register a writer with the queue. More...
 
class  MR::Thread::Queue< T >::Writer::Item
 This class is used to write items to the queue. More...
 
class  MR::Thread::Queue< T >::Reader
 This class is used to register a reader with the queue. More...
 
class  MR::Thread::Queue< T >::Reader::Item
 This class is used to read items from the queue. More...
 

Namespaces

namespace  MR
 
namespace  MR::Thread
 

Macros

#define MRTRIX_QUEUE_DEFAULT_CAPACITY   128
 
#define MRTRIX_QUEUE_DEFAULT_BATCH_SIZE   128
 

Functions

template<class Item >
__Batch< Item > MR::Thread::batch (const Item &, size_t number=128)
 used to request batched processing of items More...
 
template<class Source , class Item , class Sink >
void MR::Thread::run_queue (Source &&source, const Item &item, Sink &&sink, size_t capacity=128)
 convenience function to set up and run a 2-stage multi-threaded pipeline. More...
 
template<class Source , class Item1 , class Pipe , class Item2 , class Sink >
void MR::Thread::run_queue (Source &&source, const Item1 &item1, Pipe &&pipe, const Item2 &item2, Sink &&sink, size_t capacity=128)
 convenience functions to set up and run a 3-stage multi-threaded pipeline. More...
 
template<class Source , class Item1 , class Pipe1 , class Item2 , class Pipe2 , class Item3 , class Sink >
void MR::Thread::run_queue (Source &&source, const Item1 &item1, Pipe1 &&pipe1, const Item2 &item2, Pipe2 &&pipe2, const Item3 &item3, Sink &&sink, size_t capacity=128)
 convenience functions to set up and run a 4-stage multi-threaded pipeline. More...
 

Macro Definition Documentation

◆ MRTRIX_QUEUE_DEFAULT_BATCH_SIZE

#define MRTRIX_QUEUE_DEFAULT_BATCH_SIZE   128

Definition at line 28 of file thread_queue.h.

◆ MRTRIX_QUEUE_DEFAULT_CAPACITY

#define MRTRIX_QUEUE_DEFAULT_CAPACITY   128

Definition at line 27 of file thread_queue.h.