<html><head><meta http-equiv="Content-Security-Policy" content="script-src 'self'; img-src * cid: data:;"></head><body style="background-color: rgb(255, 255, 255); background-image: initial; line-height: initial;"><div id="response_container_BBPPID" style="outline:none;font-size:initial;font-family:&quot;Calibri&quot;,&quot;Slate Pro&quot;,sans-serif,&quot;sans-serif&quot;" dir="auto" contenteditable="false"> <div name="BB10" dir="auto" style="width: 100%; padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"> No,&nbsp;</div><div name="BB10" id="BB10_response_div_BBPPID" dir="auto" style="width: 100%; padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"><br></div><div name="BB10" id="BB10_response_div_BBPPID" dir="auto" style="width: 100%; padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);">as I see it, async / await without actors should behave the same way as if you pass continuations instead - especially if we auto convert CPS style functions into await/async style, the queueing behavior must not change IMHO.&nbsp;</div><div name="BB10" id="BB10_response_div_BBPPID" dir="auto" style="width: 100%; padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"><br></div>                            <div id="blackberry_signature_BBPPID" name="BB10" dir="auto">     <div name="BB10" dir="auto" style="padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);">Cheers<br>Marc</div> </div></div><div id="_original_msg_header_BBPPID" dir="auto">                                                                                                                                             <table width="100%" style="background-color: white; border-spacing: 0px; display: table; outline: none;" contenteditable="false"> <tbody><tr><td colspan="2" style="padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);">                           <div style="border-right: none; border-bottom: none; border-left: none; border-image: initial; border-top: 1pt solid rgb(181, 196, 223); padding: 3pt 0in 0in; font-family: Tahoma, &quot;BB Alpha Sans&quot;, &quot;Slate Pro&quot;; font-size: 10pt;">  <div id="from"><b>Von:</b> swift-evolution@swift.org</div><div id="sent"><b>Gesendet:</b> 1. September 2017 9:10 vorm.</div><div id="to"><b>An:</b> marc.schlichte@googlemail.com</div><div id="reply_to"><b>Antworten:</b> n8gray@n8gray.org</div><div id="cc"><b>Cc:</b> swift-evolution@swift.org</div><div id="subject"><b>Betreff:</b> Re: [swift-evolution] [Concurrency] A slightly different perspective</div></div></td></tr></tbody></table><div style="border-right: none; border-bottom: none; border-left: none; border-image: initial; border-top: 1pt solid rgb(186, 188, 209); display: block; padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"></div> <br> </div><!--start of _originalContent --><div name="BB10" dir="auto" style="background-image: initial; line-height: initial; outline: none;" contenteditable="false"><div dir="auto"><div><br></div><div>On Aug 31, 2017, at 3:31 PM, Marc Schlichte &lt;<a href="mailto:marc.schlichte@googlemail.com">marc.schlichte@googlemail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><br class=""><div><blockquote type="cite" class=""><div class="">Am 01.09.2017 um 00:04 schrieb Nathan Gray via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">1. Fixing "queue confusion" *must* be part of this proposal.&nbsp; The key bit of "magic" offered by async/await over continuation passing is that you're working in a single scope.&nbsp; A single scope should execute on a single queue unless the programmer explicitly requests otherwise.&nbsp; Queue hopping is a surprising problem in a single scope, and one that there's currently no adequate solution for.</div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class=""></div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">Also consider error handling.&nbsp; In this code it's really hard to reason about what queue the catch block will execute on!&nbsp; And what about the defer block?</div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class=""></div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">```</div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><font face="monospace, monospace" class="">startSpinner()</font></div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><font face="monospace, monospace" class="">defer { stopSpinner() }</font></div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><span style="font-family:monospace , monospace" class="">do {<!-- --></span><br class=""></div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><font face="monospace, monospace" class="">&nbsp; try await doSomeWorkOnSomeQ()</font></div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><font face="monospace, monospace" class="">&nbsp; try await doSomeMoreWorkOnSomeOtherQ()</font></div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><font face="monospace, monospace" class="">} catch {<!-- --></font></div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><font face="monospace, monospace" class="">&nbsp; // Where am I?</font></div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><font face="monospace, monospace" class="">}</font></div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">```</div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class=""></div><div style="font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">Please, please, PLEASE don't force us to litter our business logic with gobs of explicit queue-hopping code!</div><br class="Apple-interchange-newline"></div></blockquote></div><br class=""><div class="">In my understanding, this is the advantage of using Actors, as calling `await` on actor functions is guaranteed to continue on the queue of the calling actor.</div><div class=""><br class=""></div><div class="">Only if you call „legacy“ non-actor async functions, you have to take care of queue hopping by yourself - as you do today.</div></div></blockquote><br><div>It's true that actors would require a solution to the queue confusion problem, but not every program will want to use actors. My position is that the syntax of async/await demands a solution with or without actors. If we're ripping open the walls anyway let's fix the plumbing!</div></div><!--end of _originalContent --></div></body></html>