Community
cancel
Showing results for 
Search instead for 
Did you mean: 
genie86
Beginner
33 Views

Tasks Cancellation (What for?)

Hello everyone,
TBB offers tasks cancelation in its model, so a TBB developper can cancel tasks during runtime.
What I would like to know is the reason behind adding this cancelation model to TBB. What kind of algorithms/applications may use cancelation? Are there any TBB applications source code examples out there?
Thank you
0 Kudos
2 Replies
robert-reed
Valued Contributor II
33 Views

There are examples of its use in the Intel TBB tutorial document available attheopen source website. It is primarily a performance call, to instruct the scheduler to discard sets of queued tasks once a reason has been provided to abort their execution. There can be a number of reasons to cancel tasks: in response to an exception from the system, perhaps as a means to provide a user interrupt for long duration tasks within an application, or just to terminate an exhaustive search once some thread has found the target but perhaps before all the other threads have finished their search lists. Read about it in the tutorial.
genie86
Beginner
33 Views

Thank you Robert for your reply that was helpful.
Reply