Adding Condition Variables to tbb::thread

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

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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.

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?

All about lock-free algorithms, multicore, scalability, parallel computing and related topics: http://www.1024cores.net

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.

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

All about lock-free algorithms, multicore, scalability, parallel computing and related topics: http://www.1024cores.net

Login to leave a comment.