[PD-dev] per-thread storage in Pd in support of pdlib - discussion?
Mathieu Bouchard
matju at artengine.ca
Wed Feb 8 00:49:43 CET 2012
Le 2012-01-19 à 01:09:00, Peter Brinkmann a écrit :
> As far as libpd is concerned, I would prefer not to have any
> synchronization inside Pd itself --- libpd can be used in a wide variety
> of settings, with lots of different approaches to concurrency, and so
> it's impossible to make any assumptions about threading at this level.
If you avoid making any assumptions about threading inside Pd, then you
can't share gensym and its static table with any other instance, because
you can't ask all callers of gensym to do the locking on gensym. You can't
ask each piece of software to do its own locking on gensym, because then
they won't see each other's locks. Therefore, to share gensym, the locking
must be inside gensym.
Sharing gensym is useful so that one can prepare lists and messages
without having to lock everytime. This can allow to run the audio thread
on one processor while cooking up a big list on the other processor.
Otherwise the non-audio thread will get blocked even though the audio
thread never even looks at the symtable.
______________________________________________________________________
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC
More information about the Pd-dev
mailing list