Boost logo

Boost :

Subject: Re: [boost] Cooperative Multi-Tasking
From: Daniel Larimer (dlarimer_at_[hidden])
Date: 2010-03-04 14:43:58

On Mar 4, 2010, at 2:16 PM, Oliver Kowalke wrote:

> Daniel Larimer schrieb:
> > Back when I was in middle school I was programming on Mac OS 7,8 and 9 and remember the constant reboots from infinite loops and my high school computer science class on Win 95/98 suffered the same fate!
>> What I am trying to achieve is one real system thread per core and then distributing tasks (boost::function) among the cores. Each core would then use a cooperative system for handing asynchronous calls among actors. All of the ASIO stuff would happen in yet another real thread which would run the io_service.
>> Boost.Asio implements a concept of a strand for tasks that must happen in a particular order. I was going to add to that the concept of a 'coop' (perhaps a better name???) for tasks which don't require order, but do require that they are not actually run by two preemptive threads at the same time. This would allow you to write actors that do not need to worry about locking.
> boost.task does combine fibers/corroutines (using boost.fiber) with system threads. It prevents blocking a system thread by an task. It alows to pin a system thread to a core/cpu too.

Looking over the documentation it does seem to do a lot of the same things. I noticed that Mac OS X support has not been tested, perhaps I can do that.

How does fiber compare to Boost.coroutine in terms of context-switching performance? It seems clear that fiber is a much higher level and with boost::task most of what I have described has been done, in theory.

Is there some central repository of "reviews" or must I scan the forum logs?


Boost list run by bdawes at, gregod at, cpdaniel at, john at