[Vm-dev] [squeak-dev] Solving termination of critical sections in the context of priority inversion was: SemaphoreTest fails in trunk, is a fix needed for the 5.2 release?
David T. Lewis
lewis at mail.msen.com
Sat Jul 28 16:02:04 UTC 2018
On Sat, Jul 28, 2018 at 11:43:18AM -0300, Juan Vuletich wrote:
> Hi Eliot,
> The V3 code in Cuis was last updated on 2010, but that was just the
> comment. I went back in time, and this (except for the comment)
> identical version of the code is 10/5/2007 by Andreas.
> critical: mutuallyExcludedBlock
> "Evaluate mutuallyExcludedBlock only if the receiver is not
> currently in
> the process of running the critical: message. If the receiver is,
> mutuallyExcludedBlock after the other critical: message is finished."
> | blockValue caught |
> caught := false.
> caught := true.
> self wait.
> blockValue := mutuallyExcludedBlock value
> ] ensure: [caught ifTrue: [self signal]].
> If you are interested, in Cuis, unzip /PreviousUpdates and in file list
> set this filter: *-ar.cs.st;*-ar.?.cs.st;*-ar.??.cs.st
> This will show all the change sets in Cuis history directly based on
> Andreas' contributions. In this case it is 0104-SemaCritical-ar.cs.st
> You know this stuff better than anyone, and I'm happy to follow your
> lead here, Eliot.
> Just a question. You are using primitives #primitiveExitCriticalSection
> #primitiveTestAndSetOwnershipOfCriticalSection (185, 186, 187), that
> Cuis hasn't used so far. Are they supported by SqueakJS and the classic
Yes, these primitives are present in the classic interpreter VM since
VMMaker-dtl.278 of 10 July, 2012. I have tested this with a V3 image
on interpreter VM, and after installing the changes that Eliot has
introduced here, all tests are green in KernelTests-Processes (covering
Semaphore, Mutex and Monitor).
The primitives are also in the last classic interpreter VMs that were
published on squeakvm.org, although I did not specifically test that
(I'm in the habit of compiling my own).
It should be safe to adopt Eliot's latest changes in Cuis, and they
will work for V3 images on both Cog and classic interpreter.
More information about the Vm-dev