1 Nov 2008 08:56
Re: [threadpool] new version v12
<k-oli <at> gmx.de>
2008-11-01 07:56:53 GMT
2008-11-01 07:56:53 GMT
Am Samstag, 1. November 2008 00:53:11 schrieb Michael Marcin: > k-oli <at> gmx.de wrote: > > Hello, > > > > the new version of Boost.Threadpool depends on Boost.Fiber. > > Forgive my ignorance but http://tinyurl.com/6r3l6u claims that "fibers > do not provide advantages over a well-designed multithreaded application". > > What are the benefits of using them in a threadpool? > > Thanks, Hello Michael, using fibers in a threadpool enables fork/join semantics (algorithms which recursively splitt an action into smaller sub-actions; forking the sub-actions into separate worker threads, so that they run in parallel on multiple cores) For instance the recursive calculation of fibonacci numbers (I know it is not the best algorithm for fibonacci calculation): class fibo { private: pool_type & pool_; int offset_; int seq_( int n)(Continue reading)
I got it. This happens if migration of fibered tasks between worker-threads happens.
But what about executing fibered tasks only in the worker-thread which has created the fiber?
In Boost.Threadpool a new fiber is created for each task which has been dequeued from the global queue, the
local worker-queue or stolen from the worker-queue of another worker-thread.
If the fibered task has yield its execution it is stored into a list in the thread-specific storage (list of
unfinished fibers).
In the worker-thread loop first all fibers of the unfinished list will be executed. If a fiber becomes
RSS Feed