www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - run "thread" with memory space similar a new process

reply Dr.No <jckj33 gmail.com> writes:
Thread is "limited" to local storage, so static variables 
(including the ones marked as __gshared in D) which are globals 
are shared between the threads. So, calling not pure functions 
which depend upon global variables prevent parallization for that 
(please tell me I got anything wrong on this).

My question is:

Is there some mechanism to make a thread or whatnot run entirely 
in a new memory space context, including create their own globals 
rather share exising ones, exactly as a new process does?
I hope my question is clear. Thanks in advance.
Jun 01 2018
parent Adam D. Ruppe <destructionator gmail.com> writes:
On Friday, 1 June 2018 at 19:16:46 UTC, Dr.No wrote:
 exactly as a new process does?
Why not just create a real process?
Jun 01 2018