Boost logo

Boost :

Subject: Re: [boost] [threadpool] relation with TR2 proposal
From: k-oli_at_[hidden]
Date: 2008-09-29 03:33:47

Am Montag, 29. September 2008 08:52:52 schrieb Anthony Williams:
> joaquin_at_[hidden] writes:
> > Anthony Williams escribió:
> >> Yes. The intention was that the free function launch_in_pool would use
> >> an implementation-provided global thread pool that would be as smart
> >> as the library implementor could manage.
> >>
> >> e.g. I have a working prototype for Windows that initially runs one
> >> pool thread per CPU. If a pool thread blocks on a future for a pool
> >> task it suspends the current task and runs a new task from the pool.
> >
> > How do you do that? By re-executing the blocking task or using fibers?
> I did just execute the new task on the same stack as the existing
> task, but was mindful of the stack overflow problem that Johan
> mentioned earlier. I've now changed my prototype to use fibers to
> switch stacks. It's not perfect, as the nested task still has the same
> thread ID as another currently-executing (but suspended) task. I'm
> looking into ways to handle this, but it would really mean tying
> *everything* to the thread pool implementation.
> Like I said, it's a prototype.
> Anthony

AFAIK the coroutine library in the vault does also stack switching.
Are fibers/stack switching supported by other platforms (HP/UX, MacOS etc.)?


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