[GHC] #2910: throwTo can block indefinitely when target thread finishes with exceptions blocked

GHC trac at galois.com
Wed Jan 7 10:09:07 EST 2009


#2910: throwTo can block indefinitely when target thread finishes with exceptions
blocked
---------------------------------+------------------------------------------
    Reporter:  int-e             |        Owner:  igloo           
        Type:  merge             |       Status:  new             
    Priority:  normal            |    Milestone:  6.10.2          
   Component:  Runtime System    |      Version:  6.10.1          
    Severity:  normal            |   Resolution:                  
    Keywords:                    |   Difficulty:  Easy (1 hr)     
    Testcase:                    |           Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
---------------------------------+------------------------------------------
Comment (by simonmar):

 More patches to merge:

 {{{
 Wed Jan  7 11:20:26 GMT 2009  Simon Marlow <marlowsd at gmail.com>
   * putMVar and takeMVar: add write_barrier() to fix race with throwTo

 Wed Jan  7 12:06:52 GMT 2009  Simon Marlow <marlowsd at gmail.com>
   * fix a race where the timer signal could remain turned off, leading to
 deadlock

 Wed Jan  7 12:07:34 GMT 2009  Simon Marlow <marlowsd at gmail.com>
   * maybePerformBlockedException() should handle
 ThreadComplete/ThreadKilled
   Part of the fix for #2910

 Wed Jan  7 12:08:08 GMT 2009  Bertram Felgenhauer <int-e at gmx.de>
   * Fix two more locking issues in throwTo()

 Wed Jan  7 12:11:42 GMT 2009  Simon Marlow <marlowsd at gmail.com>
   * add comment

 Wed Jan  7 14:05:07 GMT 2009  Simon Marlow <marlowsd at gmail.com>
   * Close the races between throwTo and thread completion
   Any threads we missed were being caught by the GC (possibly the idle
   GC if the system was otherwise inactive), but that's not ideal.  The
   fix (from Bertram Felgenhauer) is to use lockTSO to synchronise,
   imposing an unconditional lockTSO on thread exit.  I couldn't measure
   any performance overhead from doing this, so it seems reasonable.
 }}}

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


More information about the Glasgow-haskell-bugs mailing list