Boost logo

Boost :

Subject: Re: [boost] [Fibers] Performance
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2014-01-14 09:05:11


> > How about comparing fiber construction and joining with thread
> > construction and joining? This will help the users to decide, is it
> > beneficial to start a new thread or to start a fiber.
> >
> > A few ideas for tests:
> > * compare construction+join of a single thread and construction+join
> > of single fiber (empty functors in both cases)
> >
>
> == compares the overhead of constructing between fiber and thread
>
>
> > * compare construction+join of a multiple threads and
> > construction+join of multiple fibers (empty functors in both cases)
> > * compare construction of a thread and construction of fiber (empty
> > functors in both cases)
> >
>
> I believe this is not a valid, because you compare the execution-time of N
> fibers running the test-function (concurrent but not parallel) in *one*
> thread with the execution-time of N threads (running parallel) while each
> single thread runs the test-function once.
>
> fibers do *not* introduce parallelism, e.g. using fibers does not gain
> benefits of multi-core systems at the first glance.
>
> Of course you could combine threads and fibers but this is not the focus
> of boost.fiber this should be done by another library.

If you constrain executing the std::threads to one core you'd get comparable
results. OTOH, if you allow to run the fibers concurrently on more than one
core you'd get comparable results again. I miss to understand why this
shouldn't be viable.

Regards Hartmut
---------------
http://boost-spirit.com
http://stellar.cct.lsu.edu


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk