[PD-dev] per-thread storage in Pd in support of pdlib - discussion?

Mathieu Bouchard matju at artengine.ca
Wed Feb 8 02:50:39 CET 2012


Le 2012-01-19 à 10:11:00, IOhannes m zmoelnig a écrit :

> it seems like i was myself mixing instances and threading. indeed what i 
> would prefer was, if i could use gensym() from another thread in a safe 
> way. this has nothing to do with a global hashtable (and i don't see a 
> reason why multiple instances should share a global hashtable)

Now that I think of it, they can't. I momentarily forgot something 
obvious.

This is because Pd's symtable is like an old LISP's symtable : the 
symtable isn't just a mapper of const char[] to t_symbol *, it's also 
giving you access to s_thing, which is the mechanism for naming [table], 
[value], [delwrite~], [receive], [send~], [catch~], and some more.

In some other systems (Smalltalk, Ruby, etc), the symtable is just a set 
of permanent strings, and there are various vartables to hold the mappings 
of t_symbol * to t_pd * (I'm translating this in pd terminology). Nearly 
all languages have such a system because it allows them to avoid having to 
turn $0-myname into 1234-myname just to be able to read a puny local 
variable.

  ______________________________________________________________________
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC


More information about the Pd-dev mailing list