GDC - program runs in one thread, DMD - in 4 threads, why?

Steven Schveighoffer schveiguy at gmail.com
Fri Sep 10 12:03:05 UTC 2021


On 9/10/21 7:47 AM, eugene wrote:
> On Friday, 10 September 2021 at 11:09:10 UTC, bauss wrote:
>> --DRT-gcopt=parallel:2 on the command line. A value of 0 disables 
>> parallel marking completely.
> 
> but it does not:
> 
> make -f Makefile-dmd
> dmd --DRT-gcopt=parallel:0 engine/*.d common-sm/*.d server-sm/*.d pool.d 
> echo_server.d -ofecho-server
> dmd --DRT-gcopt=parallel:0 engine/*.d common-sm/*.d client-sm/*.d pool.d 
> echo_client.d -ofecho-client
> 
> ps xH | grep [e]cho
>   5460 pts/14   Sl+    0:00 ./echo-server
>   5460 pts/14   Sl+    0:00 ./echo-server
>   5460 pts/14   Sl+    0:00 ./echo-server
>   5460 pts/14   Sl+    0:00 ./echo-server
>   5466 pts/15   Sl+    0:00 ./echo-client
>   5466 pts/15   Sl+    0:00 ./echo-client
>   5466 pts/15   Sl+    0:00 ./echo-client
>   5466 pts/15   Sl+    0:00 ./echo-client
> 
> 
> 

`--DRT...` is a d runtime switch, which is processed while running your 
program, not by the compiler.

Try `./echo-client --DRT-gcopt=parallel:0`

There is also a way to add this to your program so it's not needed on 
the command line.

-Steve


More information about the Digitalmars-d-learn mailing list