From: S.N.K.Wat (Stuart Watt)

Subject: RE: Need select equivalent

Date: 1999-6-1 5:10

I had a similar problem, and found blocking *output* to be more problematic
(although this is from ACLWIN 3.0.2, Windows not UNIX).  In the end, I used
the select function directly, and more or less talked to sockets manually.
Because 3.0.2 doesn't have multiprocessing, I even had to fake that up as
well.  However, I've built HTTP clients and servers, POP3 and SMTP clients
in this, and they seem pretty reliable (usually runnings for months without
crashes), and I'm happy to send code to interested people if they get in
touch with me.

This might not seem relevant, but I found that anything which expects a
network connection across the Atlantic is liable to break links once in a
while, and under these circumstances, not handling blocked output is fatal.
I didn't have a non-blocking equivalent of write-char, for example.  So, (if
you haven't thought of this already, and I certainly hadn't) I'd just
suggest you consider this issue as well.

All the best,
Stuart
==========================================
Stuart Watt
Lecturer in Knowledge Media and Psychology
Open University, Walton Hall, Milton Keynes. MK7 6AA.  UK.
WWW: http://kmi.open.ac.uk/people/snw2/
Tel: +44 1908 654513; Fax: +44 1908 653169



> -----Original Message----- > From: Jeff Dalton <aiai.ed.ac.uk] at [mailto:jeff> > Sent: 31 May 1999 15:46 > To: <cs.berkeley.edu at allegro-cl> > Subject: Need select equivalent > > > 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. >