<p dir="ltr">Yeah, it&#39;s important to distinguish:</p>
<p dir="ltr">sync/async APIs<br>
blocking/nonblocking IO<br>
preemptive/cooperative scheduling</p>
<p dir="ltr">They&#39;re all separate concepts that might go together sometimes. Johannes point was about lack of support for cooperative scheduling in Swift, but he presented it as a sync API issue.</p>
<br><div class="gmail_quote"><div dir="ltr">On Tue, May 30, 2017, 13:39 Michael Chiu &lt;<a href="mailto:hatsuneyuji@icloud.com">hatsuneyuji@icloud.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div style="word-wrap:break-word"><div><div><blockquote type="cite"><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">I don&#39;t quite see why we need (or should even offer) a synchronous API for anything that involves IO (disk, network, ...). Sure, many of us would like to have a synchronous and non-blocking programming model, that&#39;d be great. Today in Swift unfortunately we can only go asynchronous&amp;non-blocking or synchronous&amp;blocking (causing undefined behaviour [1] with setjmp/longjmp to get synchronous&amp;non-blocking is cool but certainly not supported today).</span><br></div></blockquote><div><br></div></div></div></div></div><div style="word-wrap:break-word"><div style="word-wrap:break-word"><div><div><div>I’m a bit confused here,  synchronous&amp;non-blocking can be done by kqueue/epoll/select/poll in swift.</div><div><br></div><div>It is true that kqueue and epoll are some low level C API but not having synchronous API basically screwed everyone who prefer to do their own scheduling for whatever reason.</div></div></div></div></div><div style="word-wrap:break-word"><div style="word-wrap:break-word"><div><div><div><br></div><div>Michael</div></div></div></div></div></blockquote></div>