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

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Wed Jun 18 09:51:09 EDT 2008

The only solution I can see is to implement you own thread in C, and 
make sure only your main thread talks to Scheme.


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

Posted on the users mailing list.