[squeak-dev] Strange scheduler bug/behavior

Jaromir Matas mail at jaromir.net
Wed Jun 1 14:49:40 UTC 2022


Hi,
I've just come across this strange behavior:

Try to execute this (Cmd + . will recover the image):

p := [] newProcess resume. "p placed in run queue"
p suspendedContext: nil.  "image freezes"


This can easily happen when a process gets preempted between the assignment and the next send. The scheduler apparently tries to run the waiting runnable process which has changed its suspendedContext while waiting in the run queue. I sort of expected the scheduler to disqualify such process but it looks like that's not happening.

Changing the suspendedContext while waiting is ok, I guess, as long as the new suspendedContext is a context and most of all is not nil.

I suggest a workaround in Kernel-jar.1474:

suspendedContext: aContext
                suspendedContext := aContext ifNil: [self suspend. nil]

Is this ok?

Thanks,
Jaromir


--

Jaromír Matas

mail at jaromir.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220601/a2c35297/attachment.html>


More information about the Squeak-dev mailing list