[GHC] #2123: implement waitForProcess using signals

GHC trac at galois.com
Tue Feb 26 05:34:13 EST 2008


#2123: implement waitForProcess using signals
----------------------------------+-----------------------------------------
    Reporter:  simonmar           |       Owner:             
        Type:  task               |      Status:  new        
    Priority:  normal             |   Milestone:  6.10 branch
   Component:  libraries/process  |     Version:  6.8.2      
    Severity:  normal             |    Keywords:             
  Difficulty:  Moderate (1 day)   |    Testcase:             
Architecture:  Unknown            |          Os:  Unknown    
----------------------------------+-----------------------------------------
 `waitForProcess` currently calls `waitpid` with a safe FFI call, which
 means that

  * you need to use `-threaded` to call this in a multithreaded program
  * one OS thread is needed per `waitProcess`

 instead we could implement this using the IO manager: have
 `waitForProcess` communicate with the IO manager, which wakes up the
 client when the appropriate `SIGCHLD` is received.  Note that this means
 hooking `SIGCHLD` so we'd interact badly if the program itself wanted to
 use `SIGCHLD`.

 I think it was Duncan Coutts who mentioned this idea to me.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2123>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list