Link Copied
I'll take a stab at getting this dialog started. In TBB TheArena is the data structure that keeps track of tasks and threads. It's created the first time task_scheduler_init::initialize is called with a non-deferred number of threads, when that function calls Arena::allocate_arena() and comprises three sections. The middle section is called the ArenaPrefix and contains a collection of miscellaneous data used for managing scheduling such as worker_list, the collection of worker threads attached to this arena.
After the prefix is an array of slots which is where the scheduled TBB tasks are hung. Arena allocation creates twice as many slots as available threads. Each slotmaintains a TaskPool which is a possiblearray of tasks with a couple extra fields to track status. allocate_area() reserves a slot for each worker thread and marks the rest as unused.
On the other side of the ArenaPrefix is an array of mailboxes that are indexed in the opposite direction from the slots and are used for passing tasks between threads to sort out affinities, which is where task proxies come into play.
I'll take a stab at getting this dialog started. In TBB TheArena is the data structure that keeps track of tasks and threads. It's created the first time task_scheduler_init::initialize is called with a non-deferred number of threads, when that function calls Arena::allocate_arena() and comprises three sections. The middle section is called the ArenaPrefix and contains a collection of miscellaneous data used for managing scheduling such as worker_list, the collection of worker threads attached to this arena.
After the prefix is an array of slots which is where the scheduled TBB tasks are hung. Arena allocation creates twice as many slots as available threads. Each slotmaintains a TaskPool which is a possiblearray of tasks with a couple extra fields to track status. allocate_area() reserves a slot for each worker thread and marks the rest as unused.
On the other side of the ArenaPrefix is an array of mailboxes that are indexed in the opposite direction from the slots and are used for passing tasks between threads to sort out affinities, which is where task proxies come into play.
For more complete information about compiler optimizations, see our Optimization Notice.