- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm looking at the TBB source in detail, in particular the scheduler.
What I would like to be able to do is write my own task stealing algorithm, in particular I want to be able to steal tasks from all CPUs at once (that have certain properties) and actually take them away from TBB altogether (migrate to another system).
Any pointers on where in the code I should be looking to interface? Right now I'm tracing through task.cpp, but I don't understand what is meant by "Gate" and "Arena". What are the actual task lists processed by CPUs?
Thanks,
AJ
I'm looking at the TBB source in detail, in particular the scheduler.
What I would like to be able to do is write my own task stealing algorithm, in particular I want to be able to steal tasks from all CPUs at once (that have certain properties) and actually take them away from TBB altogether (migrate to another system).
Any pointers on where in the code I should be looking to interface? Right now I'm tracing through task.cpp, but I don't understand what is meant by "Gate" and "Arena". What are the actual task lists processed by CPUs?
Thanks,
AJ
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually... I could almost use task scheduler observer for my project... I just need to know when a CPU is idle and can't steal work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
aj.guillon@gmail.com:Hi,
What I would like to be able to do is write my own task stealing algorithm, in particular I want to be able to steal tasks from all CPUs at once (that have certain properties) and actually take them away from TBB altogether (migrate to another system).
Any pointers on where in the code I should be looking to interface? Right now I'm tracing through task.cpp, but I don't understand what is meant by "Gate" and "Arena". What are the actual task lists processed by CPUs?
I'm not quite sure what you want to do... Do you want to integrate with TBB? Or to create your own solution?
Anyway, Gate is thread blocking/signaling mechanism. When worker thread is out of work it blocks on gate. When new tasks are submitted, gate is signaled. Gate is a kind of condition variable for lock-free algorithms. It allows thread to wait on predicate, but with extremely low overhead on fast-path.
Arena is work-stealing deque. But quite complicated algorithm, Cilk-style, not like work-stealing deque in Java Fork/Join Framework for example.
You can take a look at following functions.
GenericSchedule::get_task() - pops task from own work-stealing deque.
GenericSchedule::steal_task() - steals task from foreign work-stealing deque.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
aj.guillon@gmail.com:Actually... I could almost use task scheduler observer for my project... I just need to know when a CPU is idle and can't steal work.
When thread is idle and can't steal work from other threads, it calls Gate::wait() method. There is exactly one such point in source code, so you can easily identify this moment.
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