Boost logo

Boost :

Subject: Re: [boost] [Fibers] Performance
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2014-01-14 08:13:08


2014/1/14 Oliver Kowalke <oliver.kowalke_at_[hidden]>

> 2014/1/14 Antony Polukhin <antoshkka_at_[hidden]>
> > * 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.
>

Not exactly. Test function is *empty*, so you'll see the influence of
*additional* fiber/thread (overhead change beacuse of already spawned
fibers/threads).

In other words: Threads require synchronizations and OS context switches.
With growth of threads those overheads may grow. Fibers must be free from
such effects, however they can be less CPU cache friendly (in theory).

-- 
Best regards,
Antony Polukhin

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