Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jlabbesstl
Beginner
44 Views

How to catch exceptions sent by the pipeline?

Here is a simple example of what I would like to do :

m_pPipeline = new tbb::pipeline();
m_pPipeline->add_filter(*m_pElem1);
m_pPipeline->add_filter(*m_pElem2);

try{
m_pPipeline->run(2);
}
catch(EfromElem1& eElem1)
{
printf("Exception sent from the pipeline(Elem1)");
}
catch(EfromElem2& eElem2)
{
printf("Exception sent from the pipeline (Elem2)");
}

I can't find anything matching this kind of behaviour..
Is it possible? relevant? only in my dream?

Thanks for your answers.

Jeremie.
0 Kudos
2 Replies
RafSchietekat
Black Belt
44 Views

Please first consult section "9 Exceptions" in "Reference (Open Source).pdf" revision 1.13 or later (possibly in the Commercial Documentation). If it doesn't contain the right information for you, please come back here with a more specific question.
Alexey_K_Intel3
Employee
44 Views

The code implies exact propagation of exceptions across threads; and this is not possible until C++0x.
TBB uses captured_exception and movable_exception classes to use with its parallel algorithms. The former is enough to transfer information about an std::exception and its derivatives, while the latter is useful to transfer some user-defined data.
In addition to the Reference manual, you might read a series of blogs written by Andrey Marochko.
Reply