[PD-dev] stack checking

Thomas Grill gr at grrrr.org
Wed Jun 23 16:16:24 CEST 2004


Hi Krzysztof,

> I wonder, what is your opinion about other threads calling outlet
> functions -- how reliable it is, given that an outlet function in
> turn calls a method of an unknown class, possibly not thread-safe
> at all?

There are the sys_lock and sys_unlock API functions that guarantee that a
locked zone can only be active when PD is idle (is microsleep).
Call to the PD API may only be made in locked zones, therefore other
externals need not be threadsafe.

>
> Btw, do I read well, that there are two dispatching methods
> implemented in flext -- one uses the main thread, and the
> clock_set() as the trigger, while the other is background
> dispatcher, and that one is apparently default for Pd?  Is the
> background method a much better choice, empirically?

In flext there's a message queue for all messages from non-PD threads or for
explicitly queued ones.
It will only be emptied when the sys_lock is set.

sorry, in a hurry,
Thomas





More information about the Pd-dev mailing list