atom feed16 messages in at.iem.pd-listRe: threads, Was: Re: [PD] jack
FromSent OnAttachments
smoerkJul 20, 2002 3:28 am 
Frank BarknechtJul 20, 2002 5:49 am 
stefan kerstenJul 20, 2002 11:16 am 
ünter geigerJul 22, 2002 3:11 am 
Miller PucketteJul 22, 2002 10:51 am 
stefan kerstenJul 22, 2002 10:54 am 
ünter geigerJul 22, 2002 11:05 am 
CKJul 22, 2002 11:17 am 
ünter geigerJul 22, 2002 12:14 pm 
CKJul 25, 2002 7:54 am 
ünter geigerJul 25, 2002 7:58 am 
stefan kerstenJul 25, 2002 8:47 am 
Olaf MatthesJul 25, 2002 8:54 am 
stefan kerstenJul 25, 2002 9:02 am 
Miller PucketteJul 25, 2002 10:21 am 
stefan kerstenJul 25, 2002 11:09 am 
Subject:Re: threads, Was: Re: [PD] jack
From:Miller Puckette (mpuc@man104-1.ucsd.edu)
Date:Jul 25, 2002 10:21:08 am
List:at.iem.pd-list

"static" is ok if you want one separate thread to handle all instances of your extern... if, as in readsf~ and writesf~, you need a separate thread for each instance, better put the mutexes and whatnot in the instance structure.

cheers Miller

On Thu, Jul 25, 2002 at 05:55:11PM +0200, Olaf Matthes wrote:

CK schrieb:

I read:

Miller Puckette wrote:

It would have to open a separate thread to respond to the jack calls, and maintain FIFOs to synchronize between them.

which brings me to another question, what do people on the list think about multithreaded externals and shouldn't we agree now on how to implement them. AFAICT from my somewhat limited pthread knowledge each and every extern author using threads should at least prefix mutex/conditional names with externalname_ otherwise we might well deadlock ourselves sooner than later .. any other thoughts/recommendations on this ?

Well, there already are two threaded objects in the standard Pd distribution: readsf~ and writesf~. I've successfully used the same 'principles' in my oggamp~ and oggcast~ externals and can run all of them togehter (or several instances of the same object) in one patch without any difficulties. Maybe I just missed the point but I personally don't see any problems why threaded externals should interfere (as long as the mutex/conditional variables are declared as 'static'). But I also have to admit that I'm no thread-expert.... (not even a C expert, just trying until it works)