[gambit-list] Is long poll for activity on external file descriptors without Gambit reading data currently doable, and if so, how?
Christian Jaeger
christian at pflanze.mine.nu
Wed Sep 3 07:20:03 EDT 2008
Mikael More wrote:
> So this is it, a mechanism that waits for external fd:s? I.e. it adds an
> external fd to Gambit's select() call in the Scheduler,
No, this is just the functionality that waits for input or output on a
port without actually reading from it or writing to it. If you've got an
fd from your library, you need the |fd->port| first.
> and then returns
> when there's data (or one can write)?
>
Yes, if there is no timeout set then those block until input is there or
the OS output buffer can take output. If a timeout is set, they return
with #f instead of with #t, as it seems.
> So for X external fd:s, one spawns X threads and calls port-wait-for-input
> with the port as parameter, and the port in turn is the result of fd->port?
>
Yes, you usually want one Gambit thread per port / fd.
Christian.
More information about the Gambit-list
mailing list