clock function thread safety - was Re: [PD-dev] devel_0_37 branch

Miller Puckette mpuckett at man104-1.ucsd.edu
Tue Jun 3 00:29:25 CEST 2003


I think that's correct...  So at all Pd callbacks (new, free, and
message routines, even setup()) the lock would already have been obtained
by Pd, and anytime you want your own thread to call into Pd you just
lock it and go.

cheers
Miller


On Mon, Jun 02, 2003 at 09:00:21PM +0200, Thomas Grill wrote:
> Hi,
> 
> > What's wrong with simply putting a mutex around all of Pd? that way other
> > threads could just make calls right into "receive" objects without having
> > to set and wait for clock callbacks.  Perhaps I'm missing something but
> that
> > seems the much simpler solution for making threaded externs.
> >
> > Pd's scheduler would simply lock all pf Pd whenever it issues a message or
> > runs a DSP tick, and unlock it when it ``idles".
> 
> that sounds very reasonable and efficient.
> The reason why i preferred the clock functions is probably my lack of
> insight.
> Is my understanding right that there shall be something like pd_lock() and
> pd_unlock() functions that are used around every call into the pd API from a
> second thread?
> 
> best greetings,
> Thomas
> 
> 




More information about the Pd-dev mailing list