File TBBExecutor.h
↰ Parent directory (ADS/parallel)
The executor [see File Executor.h] on the threads of oneTBB, beyond the book, compiled only with ADS_WITH_TBB (the CMake option of the same name, OFF by default) and oneTBB on the path: the executor holds a task_arena of p threads, bulk( n , f ) is a parallel_for of oneTBB on the n indices with the simple partitioner (a task per index, since the patterns of Namespace ADS already give it blocks), and invoke( f , g ) is parallel_invoke, both run in the arena, so that the parallel algorithms of Namespace ADS run on the scheduler of oneTBB unchanged, and nest as its tasks do.
Definition (ADS/parallel/TBBExecutor.h)
Detailed Description
The thread that calls joins the arena and works.
The contracts [see File Contract.h]: p >= 1; an exception thrown by f is thrown again by bulk(), as oneTBB does. J. Reinders, Intel Threading Building Blocks: Outfitting C++ for Multi-core Processor Parallelism, O’Reilly, 2007
Voss, R. Asenjo, J. Reinders, Pro TBB: C++ Parallel Programming with Threading Building Blocks, Apress, 2019, doi:10.1007/978-1-4842-4398-5
- Donato Meoli
Dipartimento di Informatica Universita’ di Pisa
by Donato Meoli