[squeak-dev] The Inbox: Compiler-mt.456.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Tue Feb 2 11:23:13 UTC 2021


Ha! Tricky. I figured that #forkAt: will immediately run the process if its priority is higher than the current one:

x := 0.
[ x := 1 ] forkAt: 41.
y := x == 1. "true :-)"

However, I have no idea why the following happens:


x := 0.
[ [ x := 1 ] forkAt: 41 ] valueUnpreemptively.
y := x == 1. "false :-("


Or this:

x := 0.
[ [ x := 1 ] forkAt: 41 ] valueUnpreemptively.
Transcript showln: 'foo'.
y := x == 1. "false :-("

I would expect that "Transcript showln: 'foo'" entails many suspension points. The following, however, works for me:

x := 0.
[ [ x := 1 ] forkAt: 41 ] valueUnpreemptively.
ActiveWorld imageForm asMorph.
y := x == 1. "true :-)"

In any case, I have not yet found a way to test <noContextSwitchOnActivation>.

Best,
Marcel
Am 02.02.2021 11:23:28 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hi all!

I would like to merge <noContextSwitchOnActivation> into Trunk. But I still need a nice test case. Should be independent from the JIT. Maybe a simple setter?

foobar: value
   <noContextSwitchOnActivation>
   instVar := value

...

[ test instVar should be 42 already ] forkAt: current + 1.
self foobar: 42.

??

Best,
Marcel
Am 02.02.2021 11:06:41 schrieb commits at source.squeak.org <commits at source.squeak.org>:
A new version of Compiler was added to project The Inbox:
http://source.squeak.org/inbox/Compiler-mt.456.mcz

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

Name: Compiler-mt.456
Author: mt
Time: 2 February 2021, 11:06:33.099178 am
UUID: 0558759c-0bf7-e946-8a65-c673c49d6c8f
Ancestors: Compiler-mt.455

Forgot to remove old method. Sorry for the noise.

=============== Diff against Compiler-mt.455 ===============

Item was removed:
- ----- Method: Parser>>noContextSwitch (in category 'pragmas - code evaluation') -----
- noContextSwitch
- "By adding this pragma to a method, it will not be preempt the current process on method activation if a higher-priority process is runnable. Any numbered primitive without side effects will do here."
-
-
- "Note that primitive 123 once was primitiveValueUninteruptibly but is no longer in use."
- self addPragma: (Pragma keyword: #primitive: arguments: #(123)).
-
- self advance.
- ^ true!


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


More information about the Squeak-dev mailing list