Boost logo

Boost Users :

From: Kirit Sælensminde (kirit.saelensminde_at_[hidden])
Date: 2007-09-24 07:52:15


Torsten Mohr wrote:
> i've set up an example of a main program that starts two threads and then
> sends some data to those thread(s). When the thread(s) have processed the
> data they should notify the main program/thread and wait for new data.
>
> I'd like to make sure that what i write is also portable and does not
> just by chance work on the platform i use.
>
> boost::condition seems to be the right thing to look at, is that right?
>
> Is there some example for data communication between threads available?
>

I've just posted a recipe that implements workers executing queued jobs
and passing results back using futures. I can't directly answer for the
portability of the implementation (we've only used it on MSVC 7.1 and
MSVC 8.1), but the thread handling should be as portable as the
underlying Boost libraries.

http://www.boostcookbook.com/Recipe:/Worker%20threads%20returning%20futures

K


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net