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, and then returns when there's data (or one can write)?

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?

Mikael

2008/9/3 Christian Jaeger <christian@pflanze.mine.nu>
Christian Jaeger wrote:
Wait, I think I get what you want: you want to block your Gambit thread just as in a read or write operation but not actually carry out any read or write, correct? Just kind of peek-char that doesn't read into a buffer etc.; or basically, you want that this blocks until there is data to be read or there is the possibility to write data (pardon my shell syntax):

({read,write}-subu8vector (u8vector) 0 0 port)

That's a question for Marc I guess.
 

Ok it didn't let me calm so... check out:

http://scheme.mine.nu/gambit/experimental/wait-for-io/

(git clone http://scheme.mine.nu/gambit/experimental/wait-for-io/.git)

Christian.