[PD] object using a thread?
gr at grrrr.org
Sun Aug 28 18:20:12 CEST 2005
> otherwise, using threads in PD is just like using threads anywhere
> use the pthread stuff (which also works on windoze mitlerweile), and
> put some mutex's around your read/write operations.
threads in PD is more difficult if you need to use PD functions therein.
For that you can use sys_lock/sys_unlock (flext::Lock(),
flext::Unlock()) to be sure to be the only thread, but that's
sub-optimal because it may cause priority inversion (locking to
real-time thread for too long a time).
In flext you don't need to lock if you just want to send messages to
the outlets. These and some other functions are thread-safe.
The devel branch has some other very nice feature, namely idle
processing via callback... in many cases this is much better than using
all the best,
More information about the Pd-list