[PD-dev] message passing

Krzysztof Czaja czaja at chopin.edu.pl
Tue Jun 4 19:03:58 CEST 2002


hi,

what is the proper way (fast, robust, surviving Pd api changes)
for an external to send arbitrarily long messages, if these
messages contain a mix of data acquired through inlets and
data stored in an object?

Say, there is a function, declared as a method of an external
class, which is going to pass such a message to an 'outlet'
call.  Should this function:

1. copy data to the main stack, i.e. use a buffer in the local
memory space of a function;

2. handle a private stack ala binbuf_eval();

3. call binbuf_eval();

4. allocate with getbytes() in every call
(as pack/unpack_anything() does);

5. use a pre-allocated buffer stored in an object's memory space,
after making sure the call is not reentrant (otherwise choose one
of 1-4, or do nothing)?

I am asking this in the context of porting max classes to Pd.
I suspect, that most of the originals use method no 1.  This is
not a problem in max, in which messages cannot exceed a 256-atom
limit.  But even in max this limit might get lifted some day...

Krzysztof





More information about the Pd-dev mailing list