[squeak-dev] The Inbox: Kernel-jar.1368.mcz
Jaromir
m at jaromir.net
Mon Feb 8 21:13:42 UTC 2021
I propose the following change for consideration / discussion: modify
Process>>#priority behavior so that it guarantees no higher priority
processes remain waiting before active process continues at a lower
priority. The proposed fix only affects active process priority changes.
Replacing the method by a primitive may also be considered.
Impact: #valueUnpreemptively and #valueAt: methods are currently affected by
the #priority:'s incorrect behavior and need to be amended in any case. This
fix would cover both of them. If this fix is accepted the two methods should
remove `Processor yield` line which is not working anyway.
Related issue with examples:
http://forum.world.st/Process-gt-gt-priority-behavior-grossly-incorrect-Transcript-losing-output-td5126836.html
Test: KernelTests-jar.393 (The Inbox)
```
testPriority
"test whether #priority: preempts active process to allow higher priority
processes run"
| val oldPriority |
val := nil.
oldPriority := Processor activePriority.
Processor activeProcess priority: oldPriority + 2.
[ val := false ] forkAt: oldPriority + 1.
[ val := true ] forkAt: oldPriority.
Processor activeProcess priority: oldPriority.
self assert: val equals: Smalltalk vm processPreemptionYields
```
The test respects the current setting of #processPreemptionYields.
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html
More information about the Squeak-dev
mailing list
|