1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/// One benchmark payload, to be processed by each worker involved in each benchmark.
///
/// Payloads are created in pairs because the workers are created in pairs. Depending on the
/// benchmark scenario, the pair of payloads may be connected (e.g. reader and writer) or
/// independent (equivalent, two workers doing the same thing).
///
/// The lifecycle of a payload is:
///
/// 1. A payload pair is created on the main thread.
/// 1. Each payload in the pair is transferred to a specific thread hosting a specific worker.
/// 1. The `prepare()` method is called to generate any input data.
/// 1. The payload pair is exchanged between the two paired workers.
/// 1. The `process()` method is called to process the data received from the other pair member.
/// 1. The payload pair is dropped.
///
/// Note that some [work distribution modes][crate::WorkDistribution] (named `*Self`) may skip
/// the payload exchange step.