On Fri, 15 Feb 2008, David Matthews wrote:
An alternative would be for the run-time system to broadcast on a global condition variable after each garbage-collection so waking up any threads that needed to check for weak references that had disappeared. Since the post-GC functions would have to run on a separate thread that might actually simplify things.
Finalisation is also a possibility and could probably be written on top of these.
This global condition variable + thread solution sounds pretty reasonable to me. (Although we do not have a concrete finalisation problem at hand, but only started to think in that direction recently.)
Makarius