Win32 process spawning, POpen and Hugs, revisited

Simon Marlow simonmar at microsoft.com
Wed Mar 17 12:01:11 EST 2004


 
On a related note, I recently implemented a System.Process library on
Unix.  Source code attached.  The Windows implementation should be
relatively straightforward.  Porting it to Hugs will require
System.Posix.forkProcess, but I don't see any great difficulties there.

One warning: if you want to use it in a concurrent environment with GHC,
you need to use GHC's threaded RTS (i.e. use the -threaded option in the
forthcoming GHC 6.2.1), otherwise waitForProcess will block all threads.

POpen-type abstractions can easily be layered on top of the
functionality here - indeed the library should probably contain some
higher-level versions which correspond to common usage.

I think this is a good platform-independent abstraction for process
management.  What do others think?

Cheers,
	Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Process.hs
Type: application/octet-stream
Size: 7449 bytes
Desc: Process.hs
Url : http://www.haskell.org//pipermail/libraries/attachments/20040317/609414e2/Process-0001.obj


More information about the Libraries mailing list