<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 16, 2016 at 9:37 PM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><br>
On Sat, 16 Jan 2016, Mariano Martinez Peck wrote:<br>
<br></span>
(Still no quote.)<br>
<br>
How will you read the output of the process without having your image&#39;s process blocked in the FFI callout?<br>
How will you make sure that writes to input of the process won&#39;t block the FFI callout</blockquote><div><br></div><div><br class="">I don&#39;t see how your question are related to what I proposed of creating a plugin who exports constants. And I also don&#39;t understand what would change in that regard wether it is via FFI or plugin. Could you explain please?<br></div><div> </div><div>In any case, for the reading, I simply use none blocking pipes. Something like this:</div><div><br></div><div>fcntl(descriptor, F_SETFL, flags | O_NONBLOCK)<br></div><div><br></div><div>That way the read operations won&#39;t block and simply answer what is available on the pipe. Then, from image side, is up to the user to decide how to get it. Could be a polling loop or whatever. </div><div><br></div><div>Something I wanted to give it a try one day is to use blocking pipes but with threaded FFI callouts. But until that&#39;s in place, using non blocking pipes plus a image side polling is that I am using. </div><div><br></div><div>The writing to the stdin I think it&#39;s blocking, although I think there is non blocking writing possibility too, but I never tried.</div><div><br></div><div>Does this answer your question?</div><div><br></div></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br></div>
</div></div>