Windows: Throwing Exceptions from Fibers in D2.059: Access Violation

Jameson Ernst j.patrick.ernst at gmail.com
Thu Apr 19 20:00:54 PDT 2012


On Thursday, 19 April 2012 at 00:07:45 UTC, Sean Kelly wrote:
> On Apr 18, 2012, at 4:06 PM, Andrew Lauritzen wrote:
>
>> I'm still interested in if anyone has any suggested 
>> workarounds or experience using Win32 fibers in D2 as well.
>
> The x32 Windows code should be pretty well tested.  If this is 
> using the x64 code though, that's all quite new.  I'll give 
> this a try when I find some time, but can't suggest a 
> workaround offhand.  It almost sounds alignment-related, which 
> could be tricky.

Been following D for a while now, and fibers right in the std lib 
are a huge draw for me. I'm not an expert on them, but on the 
topic of x64 fibers, I have some exposure to them trying to 
contribute x64 windows support to bsnes, which uses its own 
home-grown fiber/coroutine system.

Out of curiosity I took a look at the D fiber context code, and 
noticed that the x64 windows version doesn't seem to save the 
XMM6-15 registers (unless I missed it), which is something I 
forgot to do also. MSDN indicates that they are nonvolatile, 
which could potentially cause problems for FP heavy code on x64 
windows.

Not sure if I should file a bug for this, as I haven't tried an 
x64 windows fiber in D yet to make sure it's actually a problem 
first.


More information about the Digitalmars-d mailing list