[squeak-dev] The Inbox: Collections-dtl.467.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Dec 23 15:39:59 UTC 2011


David T. Lewis uploaded a new version of Collections to project The Inbox:
http://source.squeak.org/inbox/Collections-dtl.467.mcz

==================== Summary ====================

Name: Collections-dtl.467
Author: dtl
Time: 23 December 2011, 10:39:33.565 am
UUID: e80ec180-bafc-434e-b902-3845f2153333
Ancestors: Collections-dtl.466

Fix weak finalization thrashing, root cause of user interrupt issues.

Perform the check for VM support of new finalization once at image startUp time. This prevents the weak finalization process from creating new weak references that result in thrashing between VM and image as the VM signals the the image to clean up weak references, and the finalization process produces additional weak to be removed.

With this change the finalization process is much less active, and user interrupt handling works as intended such that any of the following can interrupted in the expected way:

  "[true] whileTrue"
  "[[true] whileTrue] forkAt: Processor userSchedulingPriority + 1"
  "Smalltalk createStackOverflow"
  "[Smalltalk createStackOverflow] forkAt: Processor userSchedulingPriority + 1"

=============== Diff against Collections-dtl.466 ===============

Item was changed:
  ----- Method: WeakArray class>>finalizationProcess (in category 'private') -----
  finalizationProcess
  
+ 	| initialized |
+ 	initialized := false.
  	[FinalizationSemaphore wait.
+ 	initialized ifFalse: ["check VM capability once at image startup time"
+ 		WeakFinalizationList initTestPair.
+ 		Smalltalk garbageCollect.
+ 		WeakFinalizationList checkTestPair.
+ 		initialized := true].
  	FinalizationLock critical:
  		[FinalizationDependents do:
  			[ :weakDependent |
  			weakDependent ifNotNil:
  				[weakDependent finalizeValues]]]
  		ifError:
  		[:msg :rcvr | rcvr error: msg]] repeat!

Item was changed:
  ----- Method: WeakArray class>>startUp: (in category 'system startup') -----
  startUp: resuming
  	resuming ifFalse: [ ^self ].
- 	"Check if new finalization is supported by the VM"
- 	WeakFinalizationList initTestPair.
- 	WeakFinalizationList checkTestPair.
  	self restartFinalizationProcess.!




More information about the Squeak-dev mailing list