#7482: GHC.Event overwrites main IO managers hooks to RTS
    Reporter:  AndreasVoellmy    |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Milestone:                  
   Component:  libraries/base    |     Version:  7.4.1           
    Keywords:  IO Manager, RTS   |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  

Comment(by AndreasVoellmy):

 Here is a possible fix: GHC.Event.new should create a new IO manager, but
 should not register the control file descriptors with the RTS. The result
 is that the main IO manager's control file descriptors are still
 registered with the RTS, but the RTS now has no way of sending control or
 wakeup messages to the user's IO manager.

 From what I can tell, the RTS uses the registered file descriptors in the
 following ways:
 1. to call ensureIOManagerIsRunning, which starts the main (i.e. built-in)
 IO manager.
 2. to call ioManagerWakeup, to wake up one arbitrary OS thread to enter
 the scheduler loop.
 3. to call ioManagerDie
 4. to pass an OS signal to the IO manager.

 I'm fairly certain that only the main IO manager needs to get 1,2 or 4.
 I'm not absolutely certain about 3. I.e. I'm not sure if it is OK that the
 RTS cannot tell the user's manager to return from a blocking poll call
 that it may be in and exit its polling loop. If that is important, then we
 may need to provide a method for the main IO manager to send the same
 message to the user's IO manager; i.e. upon initializing the user's IO
 manager, we add a reference to it in the main IO manager.

Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7482#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

Glasgow-haskell-bugs mailing list

Reply via email to