#1364: Finalizers not guaranteed to run before the program exits
----------------------------------+-----------------------------------------
 Reporter:  [EMAIL PROTECTED]  |          Owner:  simonmar        
     Type:  feature request       |         Status:  new             
 Priority:  normal                |      Milestone:  6.10.1          
Component:  Runtime System        |        Version:  6.6.1           
 Severity:  normal                |     Resolution:                  
 Keywords:                        |     Difficulty:  Moderate (1 day)
 Testcase:                        |   Architecture:  Unknown         
       Os:  Unknown               |  
----------------------------------+-----------------------------------------
Comment (by simonmar):

 Sorry for this late review, and I'm not sure why I didn't pick this up
 before, but I think this patch has some problems.

  * we shouldn't be extending the `Foreign.ForeignPtr` API, as it is set in
 stone
    by the FFI spec and would need at the very least a library proposal to
    change it.  I had imagined that we would keep the same API, and just
 implement C
    finalizers differently.

  * The implementation doesn't seem to respect the ordering of finalizers.
    Finalizers are supposed to run in the same order that they were added
 to the
    `ForeignPtr` (which is why we have that horrible `IORef` attached to
    `ForeignPtr`s).  It looks like C finalizers will run in an arbitrary
 order.

 Once again, I'm sorry for picking this up so late.  I thought I'd reviewed
 the patch earlier, but I guess I didn't.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1364#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to