Re: How to create a new process for current window program? by Adrian
Adrian
Thu Aug 14 11:44:42 CDT 2003
>-----Original Message-----
>CYShao wrote:
>> How to create a new process for current window program?
>>
>> I see that createprocess will execute a program in new
process.
>> but I only want to copy current process and do
something different.
>> ( just like fork() on unix )
>> How can I do that??
>
>The simple answer is: you can't. The Win32 API doesn't
support anything
>like fork().
How true...but to give the guy a little clue on where to
start looking: you need to read about threads, which can
be used instead of spawning processes via fork in Unix.
The main difference you need to be aware of is that
threads all run within the SAME process. Therefore they
use the same memory space, which means you have to
synchronise access to variables etc shared between
threads.