JANA2
C++ framework for multi-threaded data processing
|
JMailbox is a threadsafe event queue designed for communication between Arrows. More...
#include <JMailbox.h>
Public Member Functions | |
size_t | get_threshold () |
size_t | get_locations_count () |
bool | is_work_stealing_enabled () |
void | set_logger (JLogger logger) |
void | set_id (int id) |
JQueue (size_t threshold, size_t locations_count, bool enable_work_stealing) | |
Protected Attributes | |
size_t | m_capacity |
size_t | m_locations_count |
bool | m_enable_work_stealing = false |
int | m_id = 0 |
JLogger | m_logger |
JMailbox is a threadsafe event queue designed for communication between Arrows.
It is different from the standard data structure in the following ways:
To handle memory locality at different granularities, we introduce the concept of a location. Each thread belongs to exactly one location, represented by contiguous unsigned ints starting at 0. While JArrows are wired to one logical JMailbox, JWorkers interact with the physical LocalQueue corresponding to their location. Locations prevent events from crossing NUMA domains as they get picked up by different JWorker threads.
T | must be moveable. Usually this is unique_ptr<JEvent>. |
Improvements: