chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Reading from TCP sockets and time outs


From: Kim
Subject: [Chicken-users] Reading from TCP sockets and time outs
Date: Thu, 1 Apr 2004 23:20:01 -0800
User-agent: Mutt/1.5.6i

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.

Suggestions or pointers would be appreciated. :)

Thank you,
Kim
 
-- 
Kim      address@hidden                 http://solluna.org/
"Nothing in the world is more dangerous than a sincere ignorance 
and conscientious stupidity" - Martin Luther King, Jr.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]