<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 10:03 AM, David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Actually, OSProcess does not need to poll. That&#39;s the purpose of<br>
AioPlugin, which notifies on data available on a descriptor (similar to<br>
what we do with socket reads).<br></blockquote><div><br></div><div>that&#39;s what I meant.  To read the output of a command without blocking the VM one needs to use AioPlugin, and that&#39;s a source of non-determinism.  Whereas if the FFI were non-blocking one could have a much more predictable, reliable and simple solution.  There are other cases too, such as DNS lookups where there are threads spawned in the VM to do the lookup without blocking the VM, which duplicates a lot of machinery.  IMO it&#39;s far better to have one single mechanism rather than several different implementations of something similar.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But deterministic or not, it isn&#39;t entirely reliable in any case.<br></blockquote><div><br></div><div>It would be great to understand this better.  But in any case I think we need this to be absolutely bullet-proof and when time is available to finish the threaded FFI IMO OSProcess should be one of the things we reimplement to use the new facilities to make it as simple as possible.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Dave<br>
<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt; Hi Tim,<br>
&gt;<br>
&gt;     but OSProcess is /not/ deterministic, because of the lack of<br>
&gt; non-blocking i/o calls.  To read from the pipes that provide the<br>
&gt; output of commands, OSProcess has to use loops that poll for output<br>
&gt; after a delay.  This is an awful hack and a source of non-determinism.<br>
&gt;  It&#39;s increasingly urgent that we have a threaded FFI and discard<br>
&gt; hacks like this, especially in key infrastructure like spawning<br>
&gt; external commands.  Fortunately thus work will likely get funded next<br>
&gt; year and my prototype should be productized some time in 2016.<br>
&gt;<br>
&gt; _,,,^..^,,,_ (phone)<br>
&gt;<br>
&gt;&gt; On Dec 9, 2015, at 8:37 PM, tim Rowledge &lt;<a href="mailto:tim@rowledge.org">tim@rowledge.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks for that summary Dave.  Ain’t it scary how a supposedly<br>
&gt;&gt; deterministic machine can seem so random?<br>
&gt;&gt;<br>
&gt;&gt; tim<br>
&gt;&gt; --<br>
&gt;&gt; tim Rowledge; <a href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
&gt;&gt; After a number of decimal places, nobody gives a damn.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>