patch applied (packages/process): More System.Process overhaul

Simon Marlow simonmarhaskell at gmail.com
Fri Jul 25 05:23:05 EDT 2008


Fri Jul 18 07:39:39 PDT 2008  Simon Marlow <marlowsd at gmail.com>
  * More System.Process overhaul
  
  New functions:
  
    callProcess :: FilePath -> [String] -> IO ()
    callCommand :: String -> IO ()
  
    spawnProcess :: FilePath -> [String] -> IO ProcessHandle
    spawnCommand :: String -> IO ProcessHandle
  
  Changes:
  
    - system and rawSystem have been removed from System.Process again.
      (they were only there temporarily after the last round of changes,
      now callCommand and callProcess replace them respectively).
  
  On Unix systems we now use SIGCHLD to detect process completion
  instead of calling waitpid().  This has several advantages:
  
    - much cheaper: no extra OS threads to do the waiting
    - doesn't require -threaded to get non-blocking waitForProcess
    - waitForProcess can be interrupted
    - no zombie process left around (only relevant on Unix)
  
  However, it relies on the new signal API (see separate proposal).  And
  these advantages aren't available on Windows (yet).

    M ./System/Cmd.hs -3 +101
    M ./System/Process.hs -217 +146
    M ./System/Process/Internals.hs -35 +180
    M ./cbits/runProcess.c -70
    M ./process.cabal -1 +1
    M ./tests/process007.hs -1 +1

View patch online:
http://darcs.haskell.org/packages/process/_darcs/patches/20080718143939-12142-1b194da7420937b3b219b7f6817181b4f9616856.gz


More information about the Cvs-libraries mailing list