[D-runtime] Fibers and x87/SSE control words?

Martin Nowak dawg at dawgfoto.de
Mon Feb 13 13:40:49 PST 2012


On Mon, 13 Feb 2012 21:52:13 +0100, Sean Kelly <sean at invisibleduck.org>  
wrote:

> On Feb 13, 2012, at 12:26 PM, Martin Nowak wrote:
>>
>> Calling Fiber.yield is just returning in an unusual manner. As Fibers
>> are not preemptive we shouldn't do that.
>
> I think Fibers can be used in two different ways.  The first is for  
> iteration and such, where the synchronous nature is intended.  The  
> second is within thread pools and such, where the fiber really is a  
> logical thread.  Any ideas for how to resolve the two?

That doesn't really change the matter. When a function returns it should  
reset
it's FPU control word if it was changed. Whether or not it's executed in a  
thread pool
makes no difference. Now if somebody calls Fiber.yield he has to restore  
all callee
cleanup state because he is literally returning to the outer context.


More information about the D-runtime mailing list