- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What happens to TLS combinable and enumerable_thread_specific objects between calls to parallel algorithms such as parallel_for? Are they destroyed? If the task_group object which initialized TLS objects is destroyed, does it destroy the TLS objects as well? What if the task_scheduler_init is destroyed or initialize method is called? What happens to TLS objects?
Thank you,
renorm.
Thank you,
renorm.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
These objects follows the same life-time rules as C++ objects of any other type with the following exception. You can think of them as a list (or vector), elements of which correspond to individual threads that accessed it. Thus when a thread gets destroyed, the element that corresponded to it is erased too. Therefore manipulations with task_scheduler_init may affect the contents of TBB TLS objects, but not their lifetime. Note also that I said "may affect". This is because terminating a particular task_scheduler_init instancenot not always destroys underlying threads.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page