[plt-scheme] Newbie question: non-blocking IO

From: YC (yinso.chen at gmail.com)
Date: Wed Jun 18 18:06:26 EDT 2008

There is a proposal for ffi+thread in
http://www.cs.brown.edu/pipermail/plt-scheme/2007-July/019592.html - does
anyone knows what happened there?

I imagine that the default file ports do not block if they are running in
separate scheme threads - is it correct?  Perhaps that can be leveraged
(i.e. pipe the FFI result to a port and then read from it)?  (I don't really
know about the details here - just making guesses...)


On Wed, Jun 18, 2008 at 6:51 AM, Chongkai Zhu <czhu at cs.utah.edu> wrote:

> The only solution I can see is to implement you own thread in C, and make
> sure only your main thread talks to Scheme.
>
> Chongkai
>
>
>
> Danny Chan wrote:
>
>> Hi!
>> I'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?
>>
>> Thanks, Danny
>>
>>
>>  _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080618/55784986/attachment.html>

Posted on the users mailing list.