[aplusdev] adap (IPC) vs Python shm module

John.Mizel at msdw.com John.Mizel at msdw.com
Fri Mar 30 15:09:08 EST 2001


Alexei,

Sorry, Adap is for socket communications between processes and doesn't
support attaching shared memory (for communctions between processes on the
same machine the host can be `localhost).  The events are generated from a
select() call for the file descriptor for the socket.  Adap is used
extensively here for passing large volumes of data between processes
around our global network.  The `A protocol even handles endian issues.

You could write some C or C++ functions that are dynamically loaded into
A+ (i.e. _dyld{...;...}) to handle attaching and reading/writing the
shared memory.

Thanks,
John


On Fri, 30 Mar 2001, Alexei Zalivine wrote:

> John,
> 
> >
> > Alexei,
> >
> > If your python is sending character data you can use the `raw protocol to
> > read it.  This protocol can generate multiple `read events for a "single"
> > message, and it is the A+ application that determines when it has received
> > a complete message.
> >
> > The `string protocol is also character based, but expects 4 bytes
> > pre-pended to the message containing its length.  This protocol doesn't
> > generate a `read event until it has the complete message.  The header
> > information is stripped from the data that is delivered to the callback
> > function.
> Thank you for advise. But I can't connect to memory. In shm python
> (http://sirac.inrialpes.fr/~marangoz/python/shm/) module more simply. Just
> define a key and other application (for example other session of python) can
> read or send data. But I don't know which arguments I must set for
> adap.Connect function.
> The adap interface like on TCP/IP protocol. IMHO IPC can work only on the
> same computer, but adap.Connect have a host, port arguments...Why?
> 
> Thank you,
> Alexei.
> 
> 

 




More information about the apluslist mailing list