There is a proposal for ffi+thread in&nbsp; <a href="http://www.cs.brown.edu/pipermail/plt-scheme/2007-July/019592.html">http://www.cs.brown.edu/pipermail/plt-scheme/2007-July/019592.html</a> - does anyone knows what happened there? <br>
<br>I imagine that the default file ports do not block if they are running in separate scheme threads - is it correct?&nbsp; Perhaps that can be leveraged (i.e. pipe the FFI result to a port and then read from it)?&nbsp; (I don&#39;t really know about the details here - just making guesses...)<br>
<br><br><div class="gmail_quote">On Wed, Jun 18, 2008 at 6:51 AM, Chongkai Zhu &lt;<a href="mailto:czhu@cs.utah.edu">czhu@cs.utah.edu</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The only solution I can see is to implement you own thread in C, and make sure only your main thread talks to Scheme.<br>
<br>
Chongkai<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
Danny Chan wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi!<br>
I&#39;d like to write a program that captures a video flow from a camera developed in my company. I already found out how to talk to the low level C libraries that are needed to talk to our hardware using the FFI. However, the functions to grab images from the camera are blocking until a data buffer has been filled. But to get the necessary frame rate, I need to process the last captured frame while waiting for the next frame. If I read the documentation correctly, PLT Scheme uses green threads, so that the call to my C function will block the scheme process even if it is done in a dedicated scheme thread. If this is correct, is there a simple way to achieve a non-blocking call to a C function?<br>

<br>
Thanks, Danny<br>
<br>
<br>
</blockquote></div></div>
_________________________________________________<br>
&nbsp;For list-related administrative tasks:<br>
&nbsp;<a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
</blockquote></div><br>