[PD] External with separate thread. Do I need to lock?
msp at ucsd.edu
Wed May 21 18:16:04 CEST 2014
Hi Rafael -
YOu can indeed pass messages to outlets or objects bound to symbols
from an arbitrary thread, protecting them between a sys_lock() and
sys_unlock() call. You can also maintain your own queue of messages
between the new thread and the Pd thread - this will be more work but
can be made absolutely robust (i.e., not depending on the safety of
the sys_lock() mechanism which I _think_ is safe but one can never be
On Wed, May 21, 2014 at 11:01:33AM -0500, Rafael Vega wrote:
> I'm developing an external that starts a separate pthread to poll some
> hardware inputs. When the outputs change, I need to send a message like [34
> 56( to one of two outlets in the external from my thread.
> Do I need to use my own mutex? or the sys_lock(), sys_unlock() calls around
> the outlet_whatever() calls? or nothing at all, just call outlet_whatever()?
> Anyone cares to give a two line explanation of the logic around this?
> Rafael Vega
> email.rafa at gmail.com
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
More information about the Pd-list