Thread overview | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
March 08, 2015 Seems core.thread.Fiber is broken dmd windows 64-bit build | ||||
---|---|---|---|---|
| ||||
The following crashes on Windows 7 sp1 64-bit edition when build at 64 bits with dmd and the Microsoft linker that comes with Windows SDK 7.1 (i.e. MSVC 2010 linker). I've had no trouble with other D code when using that arrangement, though I have not used threads. When built at 32 bits with dmd and optlink it runs fine. ============== import core.thread, std.stdio; void main() { writefln( "A pointer is %d bytes", (void*).sizeof); void f1() { writeln( 1); Fiber.yield(); writeln( 3); } auto fiber = new Fiber( &f1); fiber.call(); writeln( 2); fiber.call(); writeln( 4); } =============== The 64 bit version outputs 1 and crashes when yield is executed. Other tests reveal that yield is the problem. Should I be doing something special with linkage so this works? What is going on? |
March 09, 2015 Re: Seems core.thread.Fiber is broken dmd windows 64-bit build | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carl Sturtivant | Please confirm or deny that this is a real bug, as its getting in the way of a genuine project. How should I proceed? I'm working on a 64-bit Windows port of the following. http://www.cs.arizona.edu/icon/ Here's the 32-bit Windows port. http://www.cs.arizona.edu/icon/v95w.htm Among other things I'm using D to implement Icon's coexpressions portably using core.thread.Fiber which works fine at 32 bits. They are implemented using pthreads on other platforms, though historically there used to be a platform dependent assembly code context switch, close to the way that core.thread.Fiber is implemented. The Fiber implementation is 20 times faster at 32 bits. |
March 09, 2015 Re: Seems core.thread.Fiber is broken dmd windows 64-bit build | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carl Sturtivant | On Monday, 9 March 2015 at 14:39:34 UTC, Carl Sturtivant wrote: > Please confirm or deny that this is a real bug, as its getting in the way of a genuine project. How should I proceed? > > I'm working on a 64-bit Windows port of the following. > http://www.cs.arizona.edu/icon/ > Here's the 32-bit Windows port. > http://www.cs.arizona.edu/icon/v95w.htm > > Among other things I'm using D to implement Icon's coexpressions portably using core.thread.Fiber which works fine at 32 bits. They are implemented using pthreads on other platforms, though historically there used to be a platform dependent assembly code context switch, close to the way that core.thread.Fiber is implemented. The Fiber implementation is 20 times faster at 32 bits. I can reproduce this issue with dmd 2.066.1, please go forward and open a issue on https://issues.dlang.org/ Kind Regards Benjamin Thaut |
March 09, 2015 Re: Seems core.thread.Fiber is broken dmd windows 64-bit build | ||||
---|---|---|---|---|
| ||||
Posted in reply to Benjamin Thaut | >
> I can reproduce this issue with dmd 2.066.1,
> please go forward and open a issue on https://issues.dlang.org/
>
> Kind Regards
> Benjamin Thaut
Thank you; will do.
|
March 09, 2015 Re: Seems core.thread.Fiber is broken dmd windows 64-bit build | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carl Sturtivant | With the newest beta everything seems to work fine. http://forum.dlang.org/thread/md5kq0$8au$1@digitalmars.com |
March 09, 2015 Re: Seems core.thread.Fiber is broken dmd windows 64-bit build | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carl Sturtivant | On Sunday, 8 March 2015 at 18:18:49 UTC, Carl Sturtivant wrote:
> Should I be doing something special with linkage so this works? What is going on?
IIRC there are some fixes to the Win64 context switching code in the 2.067 or master druntime. You might want to try those first before spending more time tracking this down.
— David
|
March 09, 2015 Re: Seems core.thread.Fiber is broken dmd windows 64-bit build | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacques Müller | On Monday, 9 March 2015 at 17:00:38 UTC, Jacques Müller wrote:
> With the newest beta everything seems to work fine.
> http://forum.dlang.org/thread/md5kq0$8au$1@digitalmars.com
That's great news! Thank you.
|
March 09, 2015 Re: Seems core.thread.Fiber is broken dmd windows 64-bit build | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Nadlinger | > IIRC there are some fixes to the Win64 context switching code in the 2.067 or master druntime. You might want to try those first before spending more time tracking this down.
Great, and thanks.
|
March 09, 2015 Re: Seems core.thread.Fiber is broken dmd windows 64-bit build | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacques Müller | > http://forum.dlang.org/thread/md5kq0$8au$1@digitalmars.com
Got a working build at 64 bits using the 2.067 beta 3.
Delighted.
|
Copyright © 1999-2021 by the D Language Foundation