<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p>Hi Jaromir,</p>
<p><br>
</p>
<p>thanks a lot for the summary!</p>
<p><br>
</p>
<p>Translating this to code for my own understanding:</p>
<p><br>
</p>
<p></p>
</div>
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<div></div>
</div>
<div>p := Process forBlock: [Semaphore new wait].</div>
<div>p resume.</div>
<div>Processor yield.</div>
<div>p suspend.</div>
<div>p resume.</div>
<div>Processor yield.</div>
<div style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<div></div>
</div>
<div style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<div>{p isBlocked. p isTerminated}</div>
</div>
</blockquote>
<div style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<br>
<p></p>
<p>has answered #(false true) in the past;</p>
<p>and now answers #(true false).</p>
<p><br>
</p>
<p>> <span style="font-size: 12pt;">Alas, I don't seem to be able to squeeze it into one sentence or even less ;)</span></p>
<div><br>
</div>
<div>Hm, I will try this:</div>
<div><br>
</div>
</div>
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<div><span>Revises #suspend to remember any semaphore or monitor that the receiver has been waiting for and restore the waiting state in #resume (the old behavior is available via #suspendAndUnblock).</span></div>
</div>
</blockquote>
<div style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<div><span><br>
</span></div>
<div><span>My question is answered then. :-)</span></div>
<div><span><br>
</span></div>
<div><span>---</span></div>
<div><span><br>
</span></div>
<div><span>Please apologize that I did not read the entire linked thread. We tend to write so much that the pure reading time for this thread (let alone any comprehension) would be close to 20 minutes. =D</span></div>
<div><span><br>
</span></div>
<div><span>One last quick question: </span><span style="font-size: 12pt;">Will there be tests for #</span><span style="font-size: 12pt;">suspendAndUnblock? Maybe something like my above example?</span></div>
<div><span><span></span></span></div>
<div><span><span><br>
</span></span></div>
<div><span><span>Best,</span></span></div>
<div><span><span>Christoph</span></span></div>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Jaromir Matas <mail@jaromir.net><br>
<b>Gesendet:</b> Montag, 13. Juni 2022 08:45 Uhr<br>
<b>An:</b> The general-purpose Squeak developers list<br>
<b>Betreff:</b> Re: [squeak-dev] New #suspend semantics</font>
<div> </div>
</div>
<div>
<div style="">
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Hi Christoph,</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">The difference between the new #suspend using suspend primitive 578 and the previous one using primitive 88 is this:</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Previously, if you suspended a process waiting on a semaphore or mutex the process was removed from the semaphore or mutex; subsequent #resume would let the process continue as if the
 process had never been waiting.</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">The new suspend with primitive 578 not only removes the process from the semaphore or mutex but backs it up one instruction, i.e. before the wait send, and thus a subsequent #resume
 will allow the process go back to the wait on the semaphore or mutex, i.e. to the same state as before the suspension.</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">One of the adverse effects of the previous behavior was #critical sections could have been entered multiple times regardless of the ownership of the condition variable.</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">The previous behavior have been used (or misused) to cheaply escape a condition variable; for backward compatibility the old behavior has been preserved in #suspendAndUnblock.</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Here's more: http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-December/217831.html</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Alas, I don't seem to be able to squeeze it into one sentence or even less ;)</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Best,</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Jaromir</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="CS">--</span></p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><strong><span style="font-family:"Calibri Light",sans-serif; color:#333333; font-weight:normal">Jaromír Matas</span></strong><span style="font-family:"Calibri Light",sans-serif; color:#555555"></span></p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="font-family:"Calibri Light",sans-serif; color:#2E75B6">mail@jaromir.net</span></p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in">
<p style="border: none; padding: 0in; margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<b>From: </b><a href="mailto:christoph.thiede@student.hpi.uni-potsdam.de" style="color: blue; text-decoration: underline;">christoph.thiede@student.hpi.uni-potsdam.de</a><br>
<b>Sent: </b>Sunday, June 12, 2022 21:45<br>
<b>To: </b><a href="mailto:squeak-dev@lists.squeakfoundation.org" style="color: blue; text-decoration: underline;">squeak-dev@lists.squeakfoundation.org</a><br>
<b>Subject: </b>[squeak-dev] New #suspend semantics</p>
</div>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Hi Jaromír,<br>
<br>
as I'm currently updating the release notes, I'm trying to figure out what exactly are the visible effects of your changes to #suspend and #suspendAndUnblock from May 30.<br>
<br>
There has been written so much about this on the list in the last months that it's hard to follow up. If you could just describe the changes very briefly, probably in one or a half sentence, that would be perfect. :D<br>
<br>
Thanks in advance,<br>
Christoph<br>
<br>
<span style="color:gray">---<br>
<i>Sent from <a href="https://github.com/hpi-swa-lab/squeak-inbox-talk" style="color: blue; text-decoration: underline;">
<span style="color:gray">Squeak Inbox Talk</span></a></i></span></p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>