<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p></p>
<div style="font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont; font-size: 16px;">
Or even shorter, at a price of being hypothetically a few byte steps more expensive:</div>
<div style="font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont; font-size: 16px;">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont; font-size: 16px;">
vmParameterAt: parameterIndex ifAbsent: defaultValueOrBlock</div>
<div style="font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont; font-size: 16px;">
"Answer a VM parameter or defaultValueOrBlock value if out of range</div>
<div style="font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont; font-size: 16px;">
or if the VM does not provide a value for this parameter. A VM parameter</div>
<div style="font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont; font-size: 16px;">
is typically numeric or boolean, and if not implemented will be nil."</div>
<div style="font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont; font-size: 16px;">
</div>
<div><span style="white-space:pre"></span>^ ([self vmParameterAt: parameterIndex]</div>
<div><span style="white-space:pre"></span>on: Error do: [])</div>
<div><span style="white-space:pre"></span>ifNil: [defaultValueOrBlock value]</div>
<br>
<p></p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Thiede, Christoph<br>
<b>Gesendet:</b> Donnerstag, 16. Dezember 2021 22:58:34<br>
<b>An:</b> mail@jaromir.net; squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> AW: Regression | Cannot interrupt "[ [] repeat ] fork" anymore</font>
<div> </div>
</div>
<div>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi Jaromir,</p>
<p><br>
</p>
<p>oops, you are totally right, sorry, thank you! Hmm ... I still do not like evaluating the defaultValueOrBlock inside the exception handler.</p>
<p><br>
</p>
<p>Would you agree with this version? :-)</p>
<p><br>
</p>
<p></p>
<div>vmParameterAt: parameterIndex ifAbsent: defaultValueOrBlock</div>
<div><span style="white-space:pre"></span>"Answer a VM parameter or defaultValueOrBlock value if out of range</div>
<div><span style="white-space:pre"></span>or if the VM does not provide a value for this parameter. A VM parameter</div>
<div><span style="white-space:pre"></span>is typically numeric or boolean, and if not implemented will be nil."</div>
<div><span style="white-space:pre"></span>| result |</div>
<div><span style="white-space:pre"></span>[result := self vmParameterAt: parameterIndex]</div>
<div><span style="white-space:pre"></span>on: Error</div>
<div><span style="white-space:pre"></span>do: [^ defaultValueOrBlock value].</div>
<div><span style="white-space:pre"></span>^ result ifNil: [defaultValueOrBlock value]</div>
<br>
<p></p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> mail@jaromir.net <mail@jaromir.net><br>
<b>Gesendet:</b> Donnerstag, 16. Dezember 2021 22:16:28<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; Thiede, Christoph<br>
<b>Betreff:</b> Re: Regression | Cannot interrupt "[ [] repeat ] fork" anymore</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi Christoph,<br>
<br>
> > I just wanted to suggest<br>
> >                 ^ [(self vmParameterAt: parameterIndex)<br>
> >                                                 ifNil: [defaultValueOrBlock value]]<br>
> >                                 on: Error<br>
> >                                 do: [defaultValueOrBlock value]<br>
>  > <br>
> > i.e. without the return inside ifNil block…<br>
><br>
> The only effective difference would be that if defaultValueOrBlock is a block and raises an error, it would be evaluated a second time.
<br>
><br>
I still don't quite understand: if defaultValueOrBlock is a block and raises an error inside the ifNil block then the error would get handled by the above handler regardless whether there's a return inside the ifNil block or not - or not? :) The return should
 only evaluate after the exception resumes, I think. So actually it seems to me now the return should never get evaluated if defaultValueOrBlock raised an error (unless the error was resumable and resumed).  Or maybe I'm confused :) I'd like to be sure though
 I know how the evaluation goes in such cases, thanks!<br>
<br>
> I cannot make sense of this behavior, can you? :-) Apart from that, the non-local return is a bit slower, I know, but IMHO this should only become an argument if there is no visible change in behavior.<br>
><br>
<br>
Thanks for discussing this.<br>
<br>
Best,<br>
<br>
<br>
~~~<br>
^[^    Jaromir<br>
<br>
Sent from Squeak Inbox Talk<br>
<br>
On 2021-12-16T20:02:34+00:00, christoph.thiede@student.hpi.uni-potsdam.de wrote:<br>
<br>
> Hi Jaromir,<br>
> <br>
> <br>
> > I just wanted to suggest<br>
> >                 ^ [(self vmParameterAt: parameterIndex)<br>
> >                                                 ifNil: [defaultValueOrBlock value]]<br>
> >                                 on: Error<br>
> >                                 do: [defaultValueOrBlock value]<br>
>  ><br>
> > i.e. without the return inside ifNil block…<br>
> <br>
> <br>
> The only effective difference would be that if defaultValueOrBlock is a block and raises an error, it would be evaluated a second time. I cannot make sense of this behavior, can you? :-) Apart from that, the non-local return is a bit slower, I know, but IMHO
 this should only become an argument if there is no visible change in behavior.<br>
> <br>
> <br>
> > So the default processPreemptionYields value remains false, right?<br>
> <br>
> Apparently - without having studied the details of how preemption works in Squeak. :-)<br>
> <br>
> Best,<br>
> Christoph<br>
> <br>
> ________________________________<br>
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Jaromir Matas <mail at jaromir.net><br>
> Gesendet: Donnerstag, 16. Dezember 2021 20:47:27<br>
> An: The general-purpose Squeak developers list<br>
> Betreff: Re: [squeak-dev] Regression | Cannot interrupt "[ [] repeat ] fork" anymore<br>
> <br>
> Hi Christoph,<br>
> Yes, a good one 😊 I just wanted to suggest<br>
>                 ^ [(self vmParameterAt: parameterIndex)<br>
>                                                 ifNil: [defaultValueOrBlock value]]<br>
>                                 on: Error<br>
>                                 do: [defaultValueOrBlock value]<br>
> <br>
> i.e. without the return inside ifNil block…<br>
> <br>
> I noticed recently the image stopped responding to<br>
> Smalltalk processPreemptionYields: false<br>
> <br>
> So the default processPreemptionYields value remains false, right?<br>
> Best,<br>
> Jaromir<br>
> <br>
> From: Thiede, Christoph<<a href=""></a>mailto:Christoph.Thiede at student.hpi.uni-potsdam.de><br>
> Sent: Thursday, December 16, 2021 20:29<br>
> To: squeak-dev<<a href=""></a>mailto:squeak-dev at lists.squeakfoundation.org><br>
> Subject: Re: [squeak-dev] Regression | Cannot interrupt "[ [] repeat ] fork" anymore<br>
> <br>
> <br>
> Ha, got it! This was a small regression in SmalltalkImage >> #processPreemptionYields from dtl 1/5/2021 19:29 (System-dtl.1261). Fixed in System-ct.1268. :-)<br>
> <br>
> <br>
> <br>
> Best,<br>
> <br>
> Christoph<br>
> <br>
> Von: Thiede, Christoph<br>
> Gesendet: Donnerstag, 16. Dezember 2021 19:29:30<br>
> An: squeak-dev<br>
> Betreff: AW: [squeak-dev] Regression | Cannot interrupt "[ [] repeat ] fork" anymore<br>
> <br>
> <br>
> Hi Dave, hi Marcel,<br>
> <br>
> <br>
> <br>
> one "recent" change I noticed is that one to SmalltalkImage>>#processPreemptionYields by Dave in May, which answered false before but answers true since then. But this is just an observation, I do not know whether this change was justified by a change on
 the VM side.<br>
> <br>
> <br>
> <br>
> > even if CMD+Dot interrupts the "[ [] repeat ] fork" from the interrupt watcher<br>
> <br>
> <br>
> <br>
> How did you achieve to do this? The interrupt doesn't work for me in this situation.<br>
> <br>
> <br>
> <br>
> Best,<br>
> <br>
> Christoph<br>
> <br>
> <br>
> <br>
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
> Gesendet: Donnerstag, 16. Dezember 2021 15:53:37<br>
> An: squeak-dev<br>
> Betreff: Re: [squeak-dev] Regression | Cannot interrupt "[ [] repeat ] fork" anymore<br>
> <br>
> Hi Christoph, hi Dave, hi all --<br>
> <br>
> "Processor preemptedProcess" does not behave as it used to be. It now answers the current ui process even if CMD+Dot interrupts the "[ [] repeat ] fork" from the interrupt watcher.<br>
> <br>
> Maybe you can spot the issue right away?<br>
> <br>
> ProcessorScheduler >> preemptedProcess<br>
> "Return the process that the currently active process just preempted."<br>
> self activeProcess priority to: 1 by: -1 do: [:priority |<br>
> (quiescentProcessLists at: priority) ifNotEmpty: [:list |<br>
> ^ Smalltalk processPreemptionYields<br>
> ifTrue: [list last]<br>
> ifFalse: [list first]]].<br>
> ^ nil<br>
> <br>
> Best,<br>
> Marcel<br>
> <br>
> Am 16.12.2021 14:33:51 schrieb David T. Lewis <lewis at mail.msen.com>:<br>
> On Thu, Dec 16, 2021 at 11:27:09AM +0100, Marcel Taeumel wrote:<br>
> > Hi all --<br>
> ><br>
> > I am investigating a?? regression revealed via DebuggerTests >> test01UserInterrupt. One cannot interrupt "[ [] repeat ] fork" from a do-it anymore. :-(<br>
> ><br>
> > VM: 202112022203 (32-bit, Windows 10)<br>
> ><br>
> > Update: #20872<br>
> ><br>
> > Since the forked process should run at priority 40 and the "user interrupt watcher" watches at priority 60, this must work. Did we loose a process scheduling point in "[] repeat"? It's still implemented as "[self value. true] whileTrue".<br>
> ><br>
> <br>
> Confirming on Linux and also on an interpreter VM with trunk level V3 image,<br>
> so the issue is in the image, not the VM.<br>
> <br>
> Dave<br>
> <br>
> <br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211216/4cd96722/attachment.html">http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211216/4cd96722/attachment.html</a>><br>
> -------------- next part --------------<br>
> A non-text attachment was scrubbed...<br>
> Name: 0CB9301048554EEBA662C4875E74FF8A.png<br>
> Type: image/png<br>
> Size: 141 bytes<br>
> Desc: 0CB9301048554EEBA662C4875E74FF8A.png<br>
> URL: <<a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211216/4cd96722/attachment.png">http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211216/4cd96722/attachment.png</a>><br>
> <br>
> <br>
</div>
</span></font></div>
</body>
</html>