source: lib/combiners.h @ 0a1d2d0

Last change on this file since 0a1d2d0 was 2498008, checked in by Richard Sanger <rsangerarj@…>, 7 years ago

Refactor the combining step to allow user defined functions here.

Remove the old trace_get_results, now instead simply provide a reporter function which gets called as soon as results are ready.
The combiner function used determines the order of these results and when they are released etc.
The combiner function can be selected from those built-in or a custom version can be defined results are provided when ready.
Quickly hacked the parallel tests to work with this update, these are still a bit messy.

Also some fixes some compile warnings.

  • Property mode set to 100644
File size: 865 bytes
2 * The built-in combiner functions.
3 */
5#ifndef COMBINERS_H
6#define COMBINERS_H
8 * Takes unordered (or ordered) input and produces unordered output.
9 * Basically you get the result quickly but in no particular order.
10 */
11extern const libtrace_combine_t combiner_unordered;
13 * Takes ordered input and produces ordered output. Perpkt threads
14 * the output results must be ordered!!
15 * This will likely have to wait for a queue
16 */
17extern const libtrace_combine_t combiner_ordered;
20 * Like classic Google Map/Reduce, the results are sorted
21 * in ascending order, this is only done when the trace finishes.
22 *
23 * This only works with a limited number of results, otherwise
24 * we will just run out of memory and crash!! You should always
25 * use combiner_ordered if you can.
26 */
27extern const libtrace_combine_t combiner_sorted;
28#endif // COMBINERS_H
Note: See TracBrowser for help on using the repository browser.