[gambit-list] creating scheme ports from filehandles

Christian christian at pflanze.mine.nu
Tue Aug 1 22:33:22 EDT 2006

At 8:33 Uhr -0400 25.07.2006, Marc Feeley wrote:
>There is an internal procedure for doing this.  It is called ##open-
>predefined and you can use it like this:

Thanks, that works fine.

>My working version of Gambit has preliminary support for UDP and RAW

Perfect. (I may want to use udp for something like (or communication 
to) memcached, or other things (I've used UDP for monitoring purposes 
in the past). It's not urgent.)

>  > Maybe I should ask (instead of the
>>  above) how one can, from a C function, read/write from/to a file
>>  descriptor without blocking the system (using the scheduler, thus
>>  possibly running other scheme code in the mean time).
>One way it to use ##open-predefined and have the C code call into 
>Scheme.  Why do you need this?  There is not a general solution that
>will work in all situations.

One thing I've thought about is libraries like libmysql; but the 
problem with libmysql is that IIRC one cannot (without patching) make 
it call other functions for reading/writing, which makes it pretty 
hopeless probably, leaving only using pthread magic as solution for 
running multiple mysql connections in parallel in one Gambit. But 
I've pretty much decided to use forking/multiprocessing instead of 
multithreading for my web stuff for now, so that's no problem.


More information about the Gambit-list mailing list