<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 8 mai 2022 à 15:59, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 8 mai 2022 à 14:16, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Jaromir<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le sam. 7 mai 2022 à 14:45, Jaromir Matas <<a href="mailto:mail@jaromir.net" target="_blank">mail@jaromir.net</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div>
<p class="MsoNormal">Hi Marcel, Nicolas, Eliot,</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">> (Nicolas) I have merged Kernel-jar.1446 which is trivial (re-signal an Exception).</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks!</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">> (Marcel) Hmm... #testSimpleResignalVsOuter1 is still failing.</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">In my latest trunk image it passes ok (5/7/22)</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">>> (Marcel) I will also take a look at KernelTests-jar.421 to check whether any new semantics are okay.</p>
<p class="MsoNormal">>><u></u> <u></u></p>
<p class="MsoNormal">> (Nicolas) Yes, I did that and got two failing tests</p>
<p class="MsoNormal">> testTerminateTerminatingProcess</p>
<p class="MsoNormal">> testResumeTerminatingProcess</p>
<p class="MsoNormal">><u></u> <u></u></p>
<p class="MsoNormal">> both failures look the same, in second self assert: terminator isSuspended.</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Yes, they are supposed to fail at the moment so I suggest to make them expected failures/feature requests. However there's a stupid bug in both I’ve fixed now: they were indeed supposed to fail the following assertion:
</p>
<p class="MsoNormal">``` self should: [terminatee terminate] raise: Error. ```</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Apologies for the confusion - an updated changeset is enclosed.</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">However, there's another issue regarding the revised #suspend semantics Eliot has been working on. I've updated the process tests in KernelTests-jar.421 to test both the old and the new #suspend semantics. The two semantics should be distinguishable
 via Smalltalk processSuspensionUnblocks flag answering true in case of the old semantics and false in case of the revised one; my updated tests use this logic. However, unfortunately the latest VM answers "false" but uses the OLD suspend semantics in #suspend
 prim 88.  </p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">So I'm surprised you haven't observed more tests failing due to the new suspend semantics... What VM have you used – an older one? I'm on the latest trunk's VM 3183. And what is the answer of Smalltalk processSuspensionUnblocks? :) I'm
 utterly confused... </p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Hi Eliot - I may be confused here but if the current VM uses the old #suspend prim 88 semantics, shouldn't ```Smalltalk processSuspensionUnblocks``` answer true?</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <br></p></div></div></blockquote><div>Indeed, I can confirm that the latest VM does answer false to (Smalltalk processSuspensionUnblocks).</div><div>Though, process suspension still unblocks as shown by the example at<br></div><div><a href="https://github.com/pharo-project/pharo/issues/10669" target="_blank">https://github.com/pharo-project/pharo/issues/10669</a></div><br><div>A bit more simply, this answers false - it shouldn't:</div><div><br></div><div>s := Semaphore new.<br>p := [s wait] newProcess.<br>p resume.<br>100 milliSeconds wait.<br>p suspend; resume.<br>100 milliSeconds wait.<br>p isTerminated = Smalltalk processSuspensionUnblocks.</div><div><br> </div><div><div>technically, this answers false - it shouldn't:</div><div><br></div><div>s := Semaphore new.<br>p := [s wait] newProcess.<br>p resume.<br>100 milliSeconds wait.<br>p suspend == s = Smalltalk processSuspensionUnblocks</div><div><br></div></div></div></div></blockquote><div><br></div><div>About the latest VM, (Smalltalk processSuspensionUnblocks) answers about the behavior of primitiveSuspend (#88).</div></div></div></blockquote><div>Err,  wrong wording (Smalltalk processSuspensionUnblocks) does not describe the behavior of primitiveSuspend #(88).</div><div>It answers whether the VM has primitives #578 and #588 (see #getCogVMFeatureFlags in VMMaker)...</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div>The new Behavior is implemented by primitiveSuspendBackingUpV1 (#578) and primitiveSuspendBackingUpV2 (#588).</div><div>V1 always answers the old list (even if a Semaphore/Mutex), V2 answers nil in case of Semaphore/Mutex.</div><div><br></div><div>So, only ((Process>>#suspend) primitive) can give you a clue about the behavior, assuming that the primitive in question is implemented...<br></div><div><br></div></div></div></blockquote><div>So it depends if we want to make it a Preference, or make the image compatible with some less capable VM...</div><div><br></div><div>we could implement<br>    Process>>primitiveSuspendAndUnblock as <primitive: 88> <br>    Process>>primitiveSuspend as <primitive: 588> <br></div><div>test the VM flag in suspend</div><div>    Process>>suspend</div><div>        ^(VMHasPrimitiveSuspendBackingUp ifNil: [VMHasPrimitiveSuspendBackingUp := Smalltalk processSuspensionUnblocks not])</div><div>            ifTrue: [self primitiveSuspend]<br><div></div><div>            ifFalse: [self primitiveSuspendAndUnblock]</div><div>Then arrange to reset VMHasPrimitiveSuspendBackingUp to nil at snapshot...</div><div><br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><div></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div><p class="MsoNormal"></p></div></div></blockquote><div>I will tell next week about the status of the VM which I used for testing, it's possibly a few months old.</div></div></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div><p class="MsoNormal"><u></u></p>
<p class="MsoNormal">> (Nicolas) I would also consider 1445 1421 and most importantly 1447.</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Regarding 1421: alternatively, you might consider a newer version 1415 where the only difference is #return:from: passes a block instead of nil to #resume:through: to cause a fresh search for the first unwind context; otherwise they are
 equivalent.</p>
<p class="MsoNormal"><u></u> </p></div></div></blockquote><div>OK, I will check again.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div><p class="MsoNormal"><u></u></p>
<p class="MsoNormal">> (Marcel) Maybe we can just merge</p>
<p class="MsoNormal">><u></u> <u></u></p>
<p class="MsoNormal">> KernelTests-jar.393</p>
<p class="MsoNormal">> KernelTests-jar.418</p>
<p class="MsoNormal">> KernelTests-jar.421</p>
<p class="MsoNormal">><u></u> <u></u></p>
<p class="MsoNormal">> And go from there? Or are there any objections?</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">KernelTests-jar.393 is just a special case of a more general KernelTests-jar.418 test…</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">In my image all tests are green provided Smalltalk processSuspensionUnblocks answers true and the two above tests Nicolas mentioned are marked expected failures :)</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks very much for your feedback,</p>
<p class="MsoNormal">Jaromir</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p><span lang="CS">--</span></p>
<p><b><span style="font-family:"Calibri Light",sans-serif;color:rgb(51,51,51);font-weight:normal">Jaromír Matas</span></b><span style="font-family:"Calibri Light",sans-serif;color:rgb(85,85,85)"><u></u><u></u></span></p>
<p><span style="font-family:"Calibri Light",sans-serif;color:rgb(46,117,182)"><a href="mailto:mail@jaromir.net" target="_blank">mail@jaromir.net</a></span></p>
<p class="MsoNormal"> <br>
</p></div></div></blockquote></div></div>
</blockquote></div></div>
</blockquote></div></div>