[PD-dev] clocks & threads

Thomas Grill t.grill at gmx.net
Thu Dec 5 12:30:50 CET 2002


> My solution after some (by that time) unexplainable 'voodoo crahses' 
> with
> oggcast~ was to use clocks as a sort of callback function. I pass data
> between the main thrad of my external and it's child thread using a 
> mutex.
> The output is realised by setting a clock (from the main thread!) that 
> calls
> itselfe over and over again. In this function I then lock the mutex and
> check wether some data has changed and needs to be output.... (setting 
> a
> clock with clock_delay(myclock, 0) from within the child thread 
> crashed Pd
> (it sometimes worked for some hours but in the end it sooner or later
> crashed)).
>

When oggcast crashes while it is running alone (with no other threaded 
externals around), this would mean that the main and child thread 
collide, wouldn't it? This should be solvable by a mutex inside your 
external.

Concerning thread-safe PD... what functions do we want to be 
thread-safe?
For my part, i really only need clock_set, since all other issues are 
handled by flext.

greetings,
Thomas





More information about the Pd-dev mailing list