[squeak-dev] Trying to understand unpreemptive execution/#valueNoContextSwitch
Thiede, Christoph
Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Feb 1 16:29:03 UTC 2021
Hi all,
in the context of the current Transcript debate [1], I am trying to figure out whether, and why Marcel's proposed implementation of <noContextSwitch> [2] could work.
As a minimum example to test #valueNoContextSwitch, I tried the following:
"Try to run this infinite loop unpreemptively."
[
[[false] whileFalse] valueNoContextSwitch.
self inform: #done
] forkAt: Processor userBackgroundPriority.
Now I would have expected my image (its UI process) to freeze while p2 is running unpreemptively. But - nothing happens, i.e., all other processes are still activated! I also exchanged valueNoContextSwitch with valueUninterruptably (which I implemented using primitive 123 analogously to <noContextSwitch>) with the same result.
Here is my question: Am I misunderstanding the concept of unpreemptive/uninterruptable execution (are those two terms really synonyms?), or is unpreempted execution broken?
Assuming the former is the case, what else would be a good and simple way to find out if a process is being run unpreemptively?
And do we have any good documentation of this concept - self-documenting tests will be preferred? :-)
Best,
Christoph
[1] http://forum.world.st/Transcript-error-when-forceUpdate-false-td5126397.html
[2] http://forum.world.st/The-Inbox-Compiler-mt-454-mcz-td5126568.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210201/d793af09/attachment.html>
More information about the Squeak-dev
mailing list
|