Win32 process spawning, POpen and Hugs, revisited

David Roundy droundy at
Wed Mar 17 12:54:30 EST 2004

On Wed, Mar 17, 2004 at 02:30:30PM +0000, Graham Klyne wrote:
> Is "forkProcess" in the sense of a Unix fork?  If so, this is something 
> that is difficult to do cleanly on Windows -- normally, it requires the 
> full Cygwin emulating environment, which as far as I'm concerned is a 
> killer for deploying applications.  Theoretically, Windows NT kernel does 
> have a facility to "clone" an entire process, complete with address space 
> contents, but, as far as I'm aware this functionality is not exposed by the 
> Win32 API.

I was mixed up and thinking about threads, which we do deal with via the
win32 api.  On windows we use system to emulate "fork and exec", which we
*do* to via C and the FFI on POSIX systems.  I suppose that "fork and exec"
is easier to do on windows than a forkProcess itself, since the child
doesn't need access to the parent's memory (except enough to redirect the
stdio appropriately).
David Roundy

More information about the Libraries mailing list