[Haskell-cafe] IO and State
Jan-Willem Maessen
Janwillem.Maessen at Sun.COM
Wed Nov 17 15:40:49 EST 2004
Marcin 'Qrczak' Kowalczyk wrote:
>"Iavor S. Diatchki" <diatchki at cse.ogi.edu> writes:
>
>
>
>>I find the argument a bit disturbing, as it seems to imply that it
>>is OK for the compiler to produce code without any context switches
>>at all
>>
>>
>
>Note that in this case if the main program doesn't explicitly block
>on MVars, I/O nor timeout, then finalizers will never be run and would
>be kept in memory despite garbage collection. So such implementation
>would not be able to run certain programs which create lots of
>finalized objects, even if almost all of them become dead soon after
>creation.
>
This is little different from the situation with GC-based finalization
in other languages (cf Java). This is why finalizers are generally
viewed as a backstop to clean up resources which were accidentally left
un-freed, rather than a universal solution to cleanup.
-Jan-Willem Maessen
More information about the Haskell-Cafe
mailing list