2 Jun 2001 09:33
Weak pointers, garbage collection & deadlocks
Manuel M. T. Chakravarty <chak <at> cse.unsw.edu.au>
2001-06-02 07:33:42 GMT
2001-06-02 07:33:42 GMT
While using weak pointers and concurrency together, I became convinced that before issuing the ``no threads to run: infinite loop or deadlock?'' error message, the RTS should perform a GC. The reason is that the GC may run some finalisers, which in turn may unlock some threads. The concrete scenario that I have is that I use a finaliser to close a stream when the handle that provides input to that stream dies. Now if the only other thread is a consumer of that stream that waits for it to close, then this thread can't run before the next GC is performed and runs the finaliser. Opinions? Cheers, Manuel
RSS Feed