Thanks for the informative read.
On Mon, May 26, 2014 at 1:47 PM, Miller Puckette msp@ucsd.edu wrote:
Short answer: I started discovering that there were static structures in Pd that had ponters to symbols - all such static structures would have to be tracked down and made per-instance.
Longer one:
The specific one I hit (but this could be only one of many problems hiding there) was every single static t_class (one per class). This structure containes a list of symbols (message selectors) and associated function pointers (and more).
These are class-level selectors and function pointers only, no? It seems like an acceptable limitation to me that symbols relative to a static class definition be unique across the memory space. There is a similar limitation in the obj-c runtime, not nice but that's just part of the language.
The part that seems like it would cause a great deal of confusion would be things like send and receiver names, table names, etc. How difficult is it to make these per-instance and deal with classes as static objects that need to use sys_lock() to ensure thread safety? I realize this may not suit every use case, but it seems like this would still greatly improve the feasibility of using pd as a plug-in.
As a second alternative, I was wondering if it isn't possible to prepend a unique per-instance arg to symbols like the ones mentioned above. Of course has threading issues that would need to be resolved...
cheers, Rich