[PD-dev] Using PD funcs from inside a threaded external

Tim Blechmann tim at klingt.org
Wed Mar 18 22:47:57 CET 2009


Mathieu Bouchard wrote:
> On Wed, 18 Mar 2009, Tim Blechmann wrote:
> 
>>> The problem is that I've approached all the gphoto calling functions the
>>> same, but one particular function (listconfig) segfaults when I use PD
>>> functions, in particular outlet_symbol().
>> when calling pd's api functions from a separate thread, make sure to
>> hold the global pd lock ...
> 
> Yes, sorry, I should have known.
> 
> This is sys_lock() and sys_unlock() if pd is compiled with THREAD_LOCKING 
> enabled.

right, didn't remember the function names ...

> Afaik, this will do the rough equivalent of a [delay 0] across threads, so 
> that your (Ben's) thread's execution is inserted between two t_clock 
> events ([delay], [metro], etc.)

not really ... [delay 0] will schedule the outlet during the next dsp
tick in the pd thread ... waiting for the interpreter lock requires the
os to schedule the thread, the function and all triggered object
functions, are called in the object thread ...

tim

-- 
tim at klingt.org
http://tim.klingt.org

Linux is like a wigwam: no windows, no gates, apache inside, stable.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20090318/fa0938ed/attachment.pgp>


More information about the Pd-dev mailing list