|
ADS
Algorithms and Data Structures
|
The channels between the long-lived workers of an executor [see Executor.h], beyond the book: \( p \) workers, each with an inbox, where any worker pushes a batch of messages for another one and the owner of the inbox drains it. More...
#include "ADS/Contract.h"#include "ADS/concurrent/MPSCInbox.h"#include "ADS/concurrent/MPSCQueue.h"#include "ADS/concurrent/SPSCQueue.h"#include "ADS/parallel/Executor.h"#include <atomic>#include <concepts>#include <cstddef>#include <memory>#include <mutex>#include <span>#include <utility>#include <vector>Go to the source code of this file.
Classes | |
| class | ADS::ChannelPort< C > |
| the channels of a family seen by one worker More... | |
| class | ADS::LockedChannels< Msg, Lock > |
| the inboxes as vectors under a lock, the portable baseline More... | |
| class | ADS::InboxChannels< Msg > |
| the inboxes as stacks of Treiber of batches [see MPSCInbox.h] More... | |
| class | ADS::LaneChannels< Msg, B > |
| the inboxes as queues with a lane per sender [see MPSCQueue.h] More... | |
| class | ADS::MeshChannels< Msg > |
| the \( p^2 \) bounded queues of the pairs of workers [see SPSCQueue.h] More... | |
| struct | ADS::ChannelsOf< E > |
| the family of channels of an executor, as measured by bench/runtime.cpp (see Channels between workers): the mesh on every executor, which won the batches of 1 and of 64 messages and the round trips on the pool, OpenMP and FastFlow, with the trees a tie; a specialization may give an executor a family of its own More... | |
Namespaces | |
| namespace | ADS |
Concepts | |
| concept | ADS::ChannelFamily |
| the families of channels among \( p \) workers: tryPush( from , to ,
m ) pushes a span of messages and returns how many, drain( me , f ) calls \( f \) on the messages of the inbox of me and returns how many, size() is \( p \) | |
Typedefs | |
| template<class Msg, class E> | |
| using | ADS::DefaultChannels = typename ChannelsOf< E >::template type< Msg > |
| the family of channels to use on the executor E | |
The channels between the long-lived workers of an executor [see Executor.h], beyond the book: \( p \) workers, each with an inbox, where any worker pushes a batch of messages for another one and the owner of the inbox drains it.
All the families of channels have one interface, the concept ChannelFamily: tryPush( from , to , m ) pushes the messages of the span \( m \) from the worker from to the inbox of the worker to and returns how many it pushed (all of them but in a bounded family, which pushes those that fit), drain( me , f ) calls f( x ) on each message \( x \) found in the inbox of me, moved, and returns how many, and port( i ) binds both to the worker \( i \). The messages of a worker to another come out in the order in which it pushed them; those of different senders interleave in any order. The families differ in what an inbox is (see Channels between workers):
DefaultChannels< Msg , E > is the family to use on the executor E, chosen by the measures of bench/runtime.cpp (see Channels between workers): the mesh, on every executor measured.
The contracts [see Contract.h]: \( p \ge 1 \) workers, the indices of the workers in \( [ 0 , p ) \); only the worker from pushes as from, and only the worker me drains its inbox; f does not throw. The messages are movable, and default constructible in LaneChannels.