Boost logo

Boost Users :

From: Brian Budge (brian.budge_at_[hidden])
Date: 2008-01-29 14:37:58


Sorry, I have to amend my statement. I just ran an experiment which
launched 10000 threads vs launching 4 threads and doing the same amount of
work. Results seem to indicate that the former is quite expensive on Linux
too -- about 2 orders of magnitude different in my test.

Note that some of this effect could also be from side effects from time
slicing, etc... in the kernel scheduler.

  Brian

On Jan 29, 2008 11:25 AM, Brian Budge <brian.budge_at_[hidden]> wrote:

> Hi James -
>
> My impression was that creating new threads on Windows can be quite
> expensive, but I don't have a lot of experience there. Creating threads in
> Linux using posix_threads (also via boost) seems to be quite fast.
>
> However, I have noticed that thread_groups are much slower (factor of 4)
> than using my own vector<boost::thread*> and joining each individually.
> This is probably because I have only one controlling thread for my vector,
> so I don't need mutex.
>
> Brian
>
>
> On Jan 29, 2008 10:28 AM, James Sutherland <James.Sutherland_at_[hidden]>
> wrote:
>
> > On 1/29/08 9:54 AM, "Sebastian Gesemann" <s.gesemann_at_[hidden]> wrote:
> >
> > > You may want to try
> > http://threadpool.sourceforge.net/
> >
> > I was looking into that, but was wondering if anyone had experience to
> > suggest that creation/destruction of threads was a significant overhead
> > before I implement pools.
> >
> > James
> > _______________________________________________
> > 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