Hi Jaromir,
sorry, I'm not deep into process scheduling, I just thought it would be a trivial job. :-) Is it indisputable that Process>>#priority: should trigger the scheduler? One (me :-)) might argue naively that processes are rescheduled often enough and if waiting up to the next suspension point is not appropriate in a certain situation, senders can still #yield manually (assuming that #yield will be fixed to honor higher-priority processes as well). One might also argue that this expectation would add new overheads and side-effects to #priority:, as changing the priority of an unscheduled process does not require any invocation of the scheduler. Or am I wrong? :-)
Best, Christoph
--- Sent from Squeak Inbox Talk
On 2024-01-14T21:47:46+00:00, mail@jaromir.net wrote:
Hi Christoph,
yes, it's still an open issue. I suggested to merge it as a reminder documenting the bug. Thanks for merging.
Best, Jaromir
PS: Thanks a lot for your feedback to the other issues we've been discussing; I'll be away for a week so my responses will be delayed.
On 14-Jan-24 5:54:14 PM, christoph.thiede(a)student.hpi.uni-potsdam.de wrote:
Hi Jaromir,
is this still up to date? Would you like this to be merged into the trunk or should it go to treated?
Best, Christoph
Sent from Squeak Inbox Talk https://github.com/hpi-swa-lab/squeak-inbox-talk
On 2021-12-20T20:37:28+00:00, commits(a)source.squeak.org wrote:
A new version of KernelTests was added to project The Inbox: http://source.squeak.org/inbox/KernelTests-jar.418.mcz
==================== Summary ====================
Name: KernelTests-jar.418 Author: jar Time: 20 December 2021, 9:37:26.122961 pm UUID: 229ac303-0cfa-2d45-8d4e-e2b19b88cba8 Ancestors: KernelTests-ct.415
add a test (expected failure) to document a bug in #priority via a
failing test case. The bug was summarized in http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-December/217473....
and discussed in http://forum.world.st/The-Inbox-Kernel-jar-1368-mcz-td5126894.html and most likely requires a new primitive to fix it correctly. An
interim fix was proposed in Kernel-jar.1368 to show the desirable functionality that satisfies this test.
=============== Diff against KernelTests-ct.415 ===============
Item was added:
- ----- Method: ProcessTest>>expectedFailures (in category
'failures') -----
- expectedFailures
- ^ #(testDecreaseActiveProcessPriority)!
Item was added:
- ----- Method: ProcessTest>>testDecreaseActiveProcessPriority (in
category 'tests') -----
- testDecreaseActiveProcessPriority
- "test whether #priority: reschedules active process to allow
higher priority processes run;
- presently (12/2021) the test fails and is here to remind about
the #priority bug discussed
- in
http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-December/217473....
- and
http://forum.world.st/The-Inbox-Kernel-jar-1368-mcz-td5126894.html"
- | val oldPriority oldPreemptionYields |
- val := nil.
- oldPriority := Processor activePriority.
- oldPreemptionYields := Smalltalk processPreemptionYields.
- [
- Processor activeProcess priority: oldPriority + 2.
- [ val := false ] forkAt: oldPriority + 1.
- [ val := true ] forkAt: oldPriority.
- Processor activeProcess priority: oldPriority.
- "depending on processPreemptionYields value the active
process should be placed
- either at the beginning or the end of the
quiescentProcessLists at: oldPriority"
- self assert: val = Smalltalk processPreemptionYields.
- "test both alternative settings (true/false) of
processPreemptionYields"
- val := nil.
- Smalltalk processPreemptionYields: oldPreemptionYields not.
- Processor activeProcess priority: oldPriority + 2.
- [ val := false ] forkAt: oldPriority + 1.
- [ val := true ] forkAt: oldPriority.
- Processor activeProcess priority: oldPriority.
- self assert: val = Smalltalk processPreemptionYields.
- ] ensure: [
- "make sure processPreemptionYields is reset to its original
value even if the test fails"
- Smalltalk processPreemptionYields: oldPreemptionYields.
- self assert: Smalltalk processPreemptionYields equals:
oldPreemptionYields]!