>>>>> "gd" == G�rald Doussot <[EMAIL PROTECTED]> writes:

  gd> I feel that the solution implemented in get-servers-list-string is not
  gd> optimal. Is the function efficient in term of CPU usage?  Is there a
  gd> different way to wait for input on the stream than the one implemented
  gd> in the do iteration?

you could use CMUCL's SERVE-EVENT facility, that is a convenient
interface to the select() system call. Instead of polling regularly
for available input, you register a handler for your file descriptor,
and CMUCL will call it when the descriptor can be used for input (or
for output, depending on the options used).

This facility is documented in the SERVE-EVENT chapter of the CMUCL
User's Manual.

  <URL:http://cvs2.cons.org/ftp-area/cmucl/doc/cmu-user/serve-event.html>

Here is a simple program that uses SERVE-EVENT to forward multiple TCP
connections, without using multiprocessing:

  <URL:http://www.chez.com/emarsden/downloads/tcp-forwarder.lisp>
  
-- 
Eric Marsden                          <URL:http://www.laas.fr/~emarsden/>

  • udp G�rald Doussot
    • Eric Marsden

Reply via email to