On Sat, Oct 31, 2009 at 9:16 PM, Pau Garcia i Quiles
<[email protected]> wrote:
> On Sun, Nov 1, 2009 at 2:56 AM, OvermindDL1 <[email protected]> wrote:
>
>> I am curious, on a Windows system, to spawn a new process you
>> generally use CreateProcess, which returns immediately (it just posts
>> a message to the kernel that the kernel handles shortly.  You get back
>> a handle and a few other things.  If you want to wait for the process
>> you started to quit then you can just basically
>> WaitForEvent(theHandle), which pauses until the other process
>> terminates, then using the handle you can get things like closing code
>> and stuff like that (or during run you can hook its cin/cout and so
>> forth).  Admittedly I originally come from the DOS world long long
>> ago, but it seems rather heavyweight to me to fork an entire process
>> just to spawn another process, certainly there is a better way then
>> that?
>
> Usually a "fork" is actually a "vfork", which is lighter:
> http://en.wikipedia.org/wiki/Fork_%28operating_system%29#Vfork_and_page_sharing
>
> Also, Unices are designed so that 'fork', 'vfork', etc are cheap. This
> is not the case in Windows.
>
> In case you are going to mix 'fork' and threads, read this:
> http://unix.derkeiler.com/Newsgroups/comp.unix.programmer/2003-09/0672.html

Yea, I do already know about the shared read memory between them and
so forth, and Windows does not support fork or anything even similar,
only threads and microthreads (lightweight cooperative threading).
But it still seems to me that if you want to launch another
application, why does the process creation call block, thus requiring
you to do odd things like fork or use threads if you want to keep
things active?  Is there not an asynchronous call to create a process
as is the default in Windows?

For the record, I *really* wish Windows had fork, or any kind of
lightweight process duplication, simplifies a lot of things quite a
bit...

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to