The Trunk: Kernel-nice.1368.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-nice.1368.mcz

commits-2
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1368.mcz

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

Name: Kernel-nice.1368
Author: nice
Time: 11 February 2021, 9:30:07.084854 am
UUID: b086833d-ece4-4372-b252-87d2caa59193
Ancestors: Kernel-eem.1367

Rescue setting of Processor highestPriority: anInteger

There was a double problem:
1) if reducing the priority, then anyProcessesAbove: did behave as noProcessAbove: because (select:) isEmpty <=> noneSatisfy:
  It should have been (reject:) empty or (select:) notEmpty, but we have anySatisfy: for expressing this intention
2) if increasing the priority, then the loop did overwrite the last LinkedList in the quiescentProcessLists

Those LinkedList are mostly empty in my own image, and we never change the highestPriority, so the bug was probably benign...

=============== Diff against Kernel-eem.1367 ===============

Item was changed:
  ----- Method: ProcessorScheduler>>anyProcessesAbove: (in category 'private') -----
  anyProcessesAbove: highestPriority
+ "Do any (sub) instances of Process exist with higher priorities?"
- "Do any instances of Process exist with higher priorities?"
 
+ ^(Process allSubInstances anySatisfy: [:aProcess |
+ aProcess priority > highestPriority])!
- ^(Process allSubInstances select: [:aProcess |
- aProcess priority > highestPriority]) isEmpty
- "If anyone ever makes a subclass of Process, be sure to use allSubInstances."!

Item was changed:
  ----- Method: ProcessorScheduler>>highestPriority: (in category 'accessing') -----
  highestPriority: newHighestPriority
  "Change the number of priority levels currently available for use."
 
  | newProcessLists |
  (quiescentProcessLists size > newHighestPriority
  and: [self anyProcessesAbove: newHighestPriority])
  ifTrue: [self error: 'There are processes with priority higher than '
  ,newHighestPriority printString].
  newProcessLists := Array new: newHighestPriority.
+ 1 to: (quiescentProcessLists size min: newProcessLists size) do:
- 1 to: ((quiescentProcessLists size) min: (newProcessLists size)) do:
  [:priority | newProcessLists at: priority put: (quiescentProcessLists at: priority)].
+ quiescentProcessLists size + 1 to: newProcessLists size do:
- (quiescentProcessLists size max: 1) to: newProcessLists size do:
  [:priority | newProcessLists at: priority put: LinkedList new].
  quiescentProcessLists := newProcessLists!