[squeak-dev] The Inbox: Kernel-jar.1368.mcz
Levente Uzonyi
leves at caesar.elte.hu
Wed Feb 10 19:10:51 UTC 2021
On Wed, 10 Feb 2021, tim Rowledge wrote:
>
>
>> On 2021-02-10, at 10:30 AM, Jaromir <m at jaromir.net> wrote:
>> I did try to use #yield but the primitive
>> seems to check only the active priority queue (and assumes it can't even
>> happen that higher priority processes are waiting while a lower priority
>> process is active - which is probably a reasonable assumption - if it
>> weren't for the #priority: behavior). So I guess either #priority: or #yield
>> should be modified.
>
> That doesn't seem right; the primitiveYield carefully transfers control to the result of `wakeHighestPriority()` which is certainly *meant* to find the highest priority process that is runnable. It's what I wrote the original version to do nearly 20 years ago..
The problem is that when you change the priority via #priority:, the
process will not be placed to the list corresponding to the new priority.
Also, #yield is not optimal, because it will #yield instead of just keep
running the current process with the new priority.
IMO, the right solution is to create a new primitive if we want to
support on-the-fly priority changes.
Levente
>
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Hackers have kernel knowledge.
More information about the Squeak-dev
mailing list
|