Community
cancel
Showing results for 
Search instead for 
Did you mean: 
AJ13
New Contributor I
77 Views

Adding Condition Variables to tbb::thread

I'm not sure if condition variables are part of C++0x's thread interface, or if condition variables (like in pthreads) are even portable to non-posix systems.

However, condition variables would be useful in tbb::thread for times when there is no useful work to do (until something happens). Are there any objections to adding condition variables to tbb::thread? This is something I would do myself and look at contributing.

AJ
0 Kudos
4 Replies
RafSchietekat
Black Belt
77 Views

There is a proposal for std::condition_variable in N2800 (POSIX is just an API, without a monopoly on basic concepts).

Making such an implementation should be healthy exercise, but what would be truly exciting is a grand unification with the task-based approach.
Dmitry_Vyukov
Valued Contributor I
77 Views

Quoting - AJ
I'm not sure if condition variables are part of C++0x's thread interface, or if condition variables (like in pthreads) are even portable to non-posix systems.

However, condition variables would be useful in tbb::thread for times when there is no useful work to do (until something happens). Are there any objections to adding condition variables to tbb::thread? This is something I would do myself and look at contributing.


Since there is a tbb_thread, there must be a condition variable too...
How are you going to implement condition variable under Windows prior to Vista?

AJ13
New Contributor I
77 Views

I am only familiar with posix systems, so I wouldn't know how to implement condition variables on a non-posix system. Boost thread appears to have condition variables, so there may be some insight there.
Dmitry_Vyukov
Valued Contributor I
77 Views

Quoting - AJ
I am only familiar with posix systems, so I wouldn't know how to implement condition variables on a non-posix system. Boost thread appears to have condition variables, so there may be some insight there.

I've already submitted my eventcount proposal, so now portable low-overhead condition variable can be implemented as simple as:
http://software.intel.com/en-us/forums/showpost.php?p=72257
Reply