Greetings --
I am a fairly new user to Chicken, and I have been wrestling with a
problem that I have not yet managed to figure out soley within Chicken.
I am started to suspect I may have to skip out through the FFI to solve
it.
What I would like to have are threads that can wait/block until one of
three events happen:
1) time out
2) Data ready to be read on a (tcp) port/file descriptor
3) Another thread sends a message/signal to unblock the waiting thread
Right now, what I am trying is to have the thread manually set a timeout
with ##sys#thread-block-for-timeout! and the wait on the socket with
##sys#thread-block-for-i/o!, then calling (thread-yield!). When
the thread unblocks, I am using (file-select) to check to see if the
socket had data to be read, otherwise I check for a time out.
This does not quite seem to be working. Ideally, I would also like
to be able to use (##sys#thread-unblock!) or something similiar to
wake up a thread that is otherwise blocked on a time out or a socket.