From: Jeff Dalton

Subject: Need select equivalent

Date: 1999-5-31 10:51

By "select", I mean the Unix operation for "synchronous I/O
multiplexing".  I have some Common Lisp software that relies
heavily on select in Another Common Lisp (GCL -- I provided
the select myself in C), and I would very much like to port
this to Allegro.

So I was pleased to find that Allegro had something called
wait-for-input-available, which looked very much like select.

However, the on-line documentation for wait-for-input-available
says that "have input available" means that a call to read-char
or read-byte will immediately return without blocking, and I
also need to wait for socket connections (at which point I
would call accept, which I take it is in Allegro called
accept-connection, rather than read-char or read-byte).
(I want to wait for both sorts of readiness at once.)

So my question is: can wait-for-input-available do this, and if
not, what incredible contortions do I have to go through to
get something like that to happen?  Can I use the foreign
function stuff and call the Unix select, or will something
get messed up if I do that (because of something about how
threads are implemented)?  Do I have to create separate
threads?  (If so, I probably will just give up on Allegro
for this, because I don't have time to deal with threads
right now.)

-- jeff

Jeff Dalton,
AI Applications Institute,                               <ed.ac.uk at J.Dalton>
Edinburgh University.