- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I am trying to understand which are the reasons (all of them) why a task stealing operation could fail in TBB. From what I manage to understand so far, the receive_or_steal_task method of the custom_scheduler class is where "the magic happens". In this method, there is an infinite loop that breaks for several reasons:
- if completion_ref_count == 1. I was unable to understand when or why this situation occurs
- if the current arena is required to relinquish some threads. Because the current thread has an empty task queue, it will be relinquished by the current arena and the market will reassign it to a different arena
- if the stealing operations succeeds
- if the stealing fails but an orphan task was found and reloaded
- if the stealing fails many times (failure_count>=yield_threshold+100) meaning that there is no work to steal in the current arena and the current thread will be relinquished
Am I correct about all the above? Are there any other reasons why the stealing operation could fail? Can anyone give some details about the completion_ref_count == 1 situation?
Alexandru
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"completion_ref_count == 1" corresponds to the extra reference you have to specify in wait_for_all() or similar.

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