On 4/16/2011 11:51 AM, Sean Kelly wrote:
On Apr 16, 2011, at 11:43 AM, dsimcha wrote:
Close: If I add this instruction to the function for the new thread, the
difference goes away. The relevant statement is:
auto t = new Thread( { asm { fninit; } res2 = sumRange(terms); } );
At any rate, this is a **huge** WTF that should probably be fixed in
druntime. Once I understand it a little better, I'll file a bug report.
Read up a little on what fninit does, etc. This is IMHO a druntime bug.
Filed as http://d.puremagic.com/issues/show_bug.cgi?id=5847 .
Really a Windows bug that should be fixed in druntime :-) I know I'm
splitting hairs. This will be fixed for the next release.
The dmd startup code (actually the C startup code) does an fninit. I never
thought about new thread starts. So, yeah, druntime should do an fninit on
thread creation.