Are condition variables officially supported?

Are condition variables officially supported?

Hi guys,

Can anyone tell me what's going on with TBB support for condition variables?

I'm developing an app that is using TBB for multi-tasking, and I need condition variables.  I found an article here:  http://software.intel.com/en-us/blogs/2010/10/01/condition-variable-supp... suggesting that they're supported by TBB.  

But the condition_variable header file is burried in the "compat" subdirectory, and it doesn't show up in the HTML docs for TBB 4.0 (update 1).  That makes me wonder if the condition_variable class is going away soon, or is in some other way unsupported.

Is the idea that TBB really wants me to be using C++11's condtion_variable class, and this is just a nicety for compilers which don't yet support that part of C++11?  

4 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
imagem de Raf Schietekat

Citação:

Is the idea that TBB really wants me to be using C++11's condtion_variable class, and this is just a nicety for compilers which don't yet support that part of C++11?

Yes. Note that the class is not used by anything else in TBB (4.1 update 2), and that blocking on a mutex should be avoided inside a TBB task (blocking leads to undersubscription or worse), where a dummy_task dependency may be an appropriate replacement for a condition_variable.

Okay, thanks.  Apparently I'm not as up on C++11 features as I should have been, or else I would have noticed the the concurrency constructs in Boost and TBB were basically drop-in replacements for those in C++11.

imagem de Raf Schietekat

My impression is that boost often leads new standard functionality.

Faça login para deixar um comentário.