Thread overview
Can't use threads
May 04, 2019
Aldo
May 05, 2019
Andre Pany
May 05, 2019
Aldo
May 05, 2019
Andre Pany
May 05, 2019
zabruk
May 05, 2019
zabruk
May 06, 2019
Ron Tarrant
May 06, 2019
Aldo
May 04, 2019
Hello,

i'm trying to run 3 threads with the following code :

https://run.dlang.io/is/p4ThlD

It works on run.dlang.io but not on my windows 10 :

core.thread.ThreadError@src\core\thread.d(3078): Unable to load thread context

If I lower the allocated ubyte array it works...can you help me ?

thanks.
May 05, 2019
On Saturday, 4 May 2019 at 22:29:26 UTC, Aldo wrote:
> Hello,
>
> i'm trying to run 3 threads with the following code :
>
> https://run.dlang.io/is/p4ThlD
>
> It works on run.dlang.io but not on my windows 10 :
>
> core.thread.ThreadError@src\core\thread.d(3078): Unable to load thread context
>
> If I lower the allocated ubyte array it works...can you help me ?
>
> thanks.

Does it work on windows if you compile it it as 64 bit application (-m64 argument if I remember correctly, dub argument -a x86_64)?
On linux and Darwin 64 is default while on windows 32 bit architecture is default.

Kind regards
Andre
May 05, 2019
It works for me (Microsoft Windows [Version 10.0.17134.706] 64-bit)

start!
start!
start!
end!
end!
end!

start!
start!
end!
start!
end!
end!


May 05, 2019
DMD32 D Compiler v2.084.0

code comiled by command

dmd -i "test.d"

On Sunday, 5 May 2019 at 09:31:13 UTC, zabruk wrote:
> It works for me (Microsoft Windows [Version 10.0.17134.706] 64-bit)
>
> start!
> start!
> start!
> end!
> end!
> end!
>
> start!
> start!
> end!
> start!
> end!
> end!


May 05, 2019
On Sunday, 5 May 2019 at 03:32:37 UTC, Andre Pany wrote:
> On Saturday, 4 May 2019 at 22:29:26 UTC, Aldo wrote:
>
> Does it work on windows if you compile it it as 64 bit application (-m64 argument if I remember correctly, dub argument -a x86_64)?
> On linux and Darwin 64 is default while on windows 32 bit architecture is default.
>
> Kind regards
> Andre

No. I tried to compile it as 64 bit and 32, I lowered ubyte[] data to 4096, and I still have this exception.

Used dub and dmd -i to compile.

Thats weird.
May 05, 2019
On Sunday, 5 May 2019 at 12:28:34 UTC, Aldo wrote:
> On Sunday, 5 May 2019 at 03:32:37 UTC, Andre Pany wrote:
>> On Saturday, 4 May 2019 at 22:29:26 UTC, Aldo wrote:
>>
>> Does it work on windows if you compile it it as 64 bit application (-m64 argument if I remember correctly, dub argument -a x86_64)?
>> On linux and Darwin 64 is default while on windows 32 bit architecture is default.
>>
>> Kind regards
>> Andre
>
> No. I tried to compile it as 64 bit and 32, I lowered ubyte[] data to 4096, and I still have this exception.
>
> Used dub and dmd -i to compile.
>
> Thats weird.

What I can see from source code in DRuntime, windows api GetThreadContext is failing, therefore the error message you can see. Can you test it with a recent version of dmd and if error still exists, please file an issue on issues.dlang.org

Kind regards
Andre
May 06, 2019
On Saturday, 4 May 2019 at 22:29:26 UTC, Aldo wrote:

> i'm trying to run 3 threads with the following code :
>
> https://run.dlang.io/is/p4ThlD

Works for me...

Windows 10 Pro
DMD 2.085.1 (-de -w -m64 switches)

Note: I didn't use dub, so perhaps there's something going on there.
May 06, 2019
On Monday, 6 May 2019 at 09:46:46 UTC, Ron Tarrant wrote:
> On Saturday, 4 May 2019 at 22:29:26 UTC, Aldo wrote:
>
>> i'm trying to run 3 threads with the following code :
>>
>> https://run.dlang.io/is/p4ThlD
>
> Works for me...
>
> Windows 10 Pro
> DMD 2.085.1 (-de -w -m64 switches)
>
> Note: I didn't use dub, so perhaps there's something going on there.

Tried the code at work, its working on a Windows 10 machine...it's crazy. I used the same DMD (last release)...I will try to debug this at home later.

Thanks for your help.