Libthreadar 1.4.0
|
defines structure that is suitable to gather data from many workers More...
#include "config.h"
#include <vector>
#include <map>
#include <deque>
#include <memory>
#include "mutex.hpp"
Go to the source code of this file.
Classes | |
class | libthreadar::ratelier_gather< T > |
the class ratelier_gather has a fixed length range of slots of arbitrary defined object type More... | |
Namespaces | |
namespace | libthreadar |
This is the only namespace used in libthreadar and all symbols provided by libthreadar are member of this namespace. | |
defines structure that is suitable to gather data from many workers
each worker can fill its job result to the ratelier_gather with an index number. This index is used for to provide the jobs in sequence to the gathering thread and starts to zero. If a index is missing no data is delivered to the gathering thread until a worker thread provide it. The gathering thread is thus garantied that whatever the execution order of workers their resulting job is provided in sequence to the gathering thread.
the original design for this class is to work in conjunction with a ratelier_scatter when a sequences data has to be processed by many workers but the resulting of the process should also be ordered following the original data the process worked in
+--------------------+ | scattering thread | +--------------------+ | | V (ratelier_scatter) / | \ / | \
+----—+ +----—+ +----—+ |worker1| |worker2| |worker3| +----—+ +----—+ +----—+ \ | / \ | / V V V (ratelier_gather) | | V +-----------------—+ | gathering thread | +-----------------—+
Definition in file ratelier_gather.hpp.