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

Jaromir Matas m at jaromir.net
Sun Feb 28 22:48:38 UTC 2021


>
> 
> 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.
>
> ??
>

Hi Marcel,
is it even possible to test #valueNoContextSwitch? I'm trying to understand
what would that require: you'd like to catch a higher priority process
trying to interrupt (preempt) a block activation between the
#valueNoContextSwitch send and the first context switching point inside the
block - right? Like a non-primitive send etc. So it's a very short period of
time you're targeting before the first switching point. I was thinking along
the lines of:

x := 0.
[1 milliSecond wait. x := x+1000000] forkAt:41.
[[x:=x+1. x<1000000] whileTrue] valueNoContextSwitch.
x 

but x returns  e.g. 1084476 meaning whileTrue must be a context switching
point (because it's a backward jump?) and 1 millisecond is a desperately
long period...

My question - is this at least the right understanding? If yes, could you
think of any time consuming operations that would not contain any switching
points? To get past the 1 msec? I'm really curious. Thanks!



-----
^[^ Jaromir
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html


More information about the Squeak-dev mailing list