std.concurrency and fibers

Alex Rønne Petersen alex at lycus.org
Thu Oct 4 21:20:47 PDT 2012


On 05-10-2012 01:34, Sean Kelly wrote:
> On Oct 4, 2012, at 5:48 AM, Timon Gehr <timon.gehr at gmx.ch> wrote:
>>
>> What about the stack? Allocating a fixed-size stack per task is costly
>> and Walter opposes dynamic stack growth.
>
> This is another reason I've been delaying using fibers.  The correct approach is probably to go the distance by reserving a large block, committing only a portion, and commit the rest dynamically as needed.  The current fiber implementation does have a guard page in some cases, but doesn't go so far as to reserve/commit portions of a larger stack space.
>

I think we'd need compiler support to be able to do it in a reasonable 
way at all. Doing it via OS virtual memory hacks seems like a bad idea 
to me.

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list