Mantis - Squeak
Viewing Issue Advanced Details
7546 Kernel major always 06-13-10 08:08 02-06-11 23:48
JoachimGeidel  
leves  
normal  
closed 4.1  
fixed  
none    
none trunk  
0007546: WeakRegistry deadlock during finalization
In Squeak 4.1, I encountered a deadlock problem related to Squeak's current
WeakRegistry implementation when the JVM is started. This problem
disappeared when I changed the finalizationProcess of WeakArray such that it
runs at systemBackgroundPriority instead of userBackgroundPriority. However, normal processes (with priority 40) could starve the finalization
process if it's priority were <= 40 (#systemBackgroundPriority is 20).

To reproduce, load JNIPort into Squeak 4.1, and start a JVM as described on http://www.squeaksource.com/JNIPort.html. [^] At the point where the deadlock occurs, the finalizationProcess sends #wait to the accessLock of WeakRegistry, then the Process which initializes the JVM waits on the same Semaphore until the process is interrupted by a user interrupt. After proceeding, the interrupted process proceeds, signals the accessLock, and only after this, the finalizationProcess finishes finalizeValues and signals the accessLock. Lowering the priority of the finalizationProcess works around this problem, but probably simply by completely stopping finalization until the JVM initialization has finished.

Notes
(0013818)
leves   
06-19-10 20:41   
Fixed in Collections-ul.365.