- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
What is the best/recommended way of cancelling a tbb::task after it has been spawned? As far as I can see, this is not possible without waiting for the task execute() to complete.
If not cancellation is supported, what was the design decision for this?
Cheers,
//Bjrn Tpel
What is the best/recommended way of cancelling a tbb::task after it has been spawned? As far as I can see, this is not possible without waiting for the task execute() to complete.
If not cancellation is supported, what was the design decision for this?
Cheers,
//Bjrn Tpel
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Task cancellation was left out of the original design because we didn't have enough experience to guide us on doing it right. Now that we have experience, we're working on task cancellation and exception-safe tasks and have a design that seems towork well for both.
For now, the best way is to have the task poll a shared cache line. My blog http://softwareblogs.intel.com/2007/11/08/have-a-fish-how-break-from-a-parallel-loop-in-tbb/explains how to do this in the context of parallel_for by defining a cancelable_range object that "collapses" when the loop is cancelled.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interresting! Do you have a time frame when we can expect the cancellation functionality to appear in a developer release?
Thanks for the blog pointer.
Cheers,
//Bjrn
Thanks for the blog pointer.
Cheers,
//Bjrn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
End of January 2008 is the current target for puttingcancellation/exception-safe tasks in the developer release.
- Arch
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