Boost logo

Boost :

Subject: Re: [boost] Cooperative Multi-Tasking
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-03-04 16:32:54


Hi,
----- Original Message -----
From: "Daniel Larimer" <dlarimer_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, March 04, 2010 8:43 PM
Subject: Re: [boost] Cooperative Multi-Tasking

>
>
> 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?

There is no such a central repository of review. You can use http://old.nabble.com/Boost---Dev-f14201.html to query for task, fiber, threadpool.

HTH,
Vicente


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