From: Sylvain &
Subject: Efficient broadcasting
Date: 
Message-ID: <20158@pitt.UUCP>
Hi!

I am using Allegro CL 4.1 on a Decstation 5000 and I am trying to broadcast
messages in the Internet domain within a group.

Using the IPC package provided by Allegro, the obvious solution is
to send the message to every member of the group in a one-to-one
way... but this is terribly inefficient. 
In C it is possible to have an efficient broadcasting (i.e. you do not
send n times the same message to n different clients).
Does anyone know how can I do it in Lisp?

Thank you,

Sylvain.

P.S: If this is not the correct newsgroup for this type of questions
     to which newsgroup should I post it?
From: Steve Haflich
Subject: Re: Efficient broadcasting
Date: 
Message-ID: <SMH.93Aug17050513@akbar.Franz.COM>
In article <·····@pitt.UUCP> ······@cs.pitt.edu (Sylvain &) writes:

   I am using Allegro CL 4.1 on a Decstation 5000 and I am trying to broadcast
   messages in the Internet domain within a group.

   Using the IPC package provided by Allegro, the obvious solution is
   to send the message to every member of the group in a one-to-one
   way... but this is terribly inefficient. 
   In C it is possible to have an efficient broadcasting (i.e. you do not
   send n times the same message to n different clients).
   Does anyone know how can I do it in Lisp?

I think you are miscasting this as a language (Lisp vs C) question
rather than a networking question.  Actual, it's unclear from your
question whether you are referring to sending broadcast network
packets, or using the broadcast capability of RPC, but it doesn't
affect the gist of my answer.

The way you send broadcast packets in C is by calling some set of
library routines to establish a socket, bind it to a broadcast
address, and then to send a packet.  The way you do it in lisp (or
pascal or assembly language) is also by calling some set of library
routines, in fact, the exact same library functions, in the same way,
with the same arguments.  If you know how to implement the problem in
one language, and you know some other language, then in principle you
know how to solve it in both.  For example, the source for
ipc:open-network-stream looks very similar with regard to calling
network routines as C code to implement the same functionality.

There are lots of gotcha's, of course: using lisp foreign functions
requires the programmer to attend to the datatype and calling
conventions of the two languages.  Also, in a full-blown interactive
lisp image there may be other activities going on (e.g. the scheduler)
that may use some per-Unix-process global resource (e.g. the Unix
SIGALRM timer) that might be needed by some library functions (e.g. a
few RPC facilties).  The per-process resources of Unix aren't well
designed to allow combining in a single executing image software
libraries that weren't written with cognizance of one another.
However, this too isn't language-specific, and would also be a
limitation in a C application that needed to use the timer and make
these particular RPC calls.