[Haskell-cafe] Re: Problem with finalizers

2007-05-15 Thread Simon Marlow
Ivan Tomac wrote: It appears that if I add import Control.Concurrent and call yield just after performGC then the finalizer does get called. But it only seems to work if I call both performGC and yield and in that order. There is no guarantee that a finalizer will be run before your program

[Haskell-cafe] Re: Problem with finalizers

2007-05-15 Thread Ivan Tomac
Hi Simon, On 15/05/2007, at 8:31 PM, Simon Marlow wrote: There is no guarantee that a finalizer will be run before your program exits. The only thing you can be sure of is that it will *not* run while the ForeignPtr is still reachable by the garbage collector. In practice GHC will