Boost logo

Boost Users :

Subject: Re: [Boost-users] General design question about threading/concurrency
From: Brian Budge (brian.budge_at_[hidden])
Date: 2010-10-24 17:00:50


I'm not aware of any task management stuff that comes with the boost
libraries. boost::thread is pretty much a straightforward wrapper to
lower-level threading concepts.

I would usually build up some kind of task queue/stack that is either
locking or concurrent and non-locking that manages the tasks. Then
you can start M threads where M is the number of cores on your
machine. These threads can then "steal" the work from the task queue,
and/or add new tasks to the task queue until the tasks are finished.

TBB (intel thread building blocks) has some of this already in place
to make it easier to write these kinds of programs, but I typically
roll my own and use boost threads directly as I have seen better
performance.

  Brian

On Sun, Oct 24, 2010 at 1:44 PM, Julien Martin <balteo_at_[hidden]> wrote:
> Hello,
> I am writing a program that needs to run N simulations with N >10 000.
> Obviously, I cannot instantiate N threads at the same time but I cannot run
> the simulations sequentially either.
> Can anyone please advise me how to design my program using the boost
> threading library and concepts please?
> Thanks in advance,
> Julien.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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