hi,
here's a pthread template that works for me: http://www.workinprogress.ca/pure-data-external-pthread-template/
pat
Hi, Pat
It looks interesting, but I'm not sure yet how you use it. So, you write an external, and some of the routines can be wrapped up with (or called from) the pthread templates? Or do you take your routines and find/replace names to write your externals?
I've been studying parallel programming a lot lately, and it's given me some ideas for Pd, namely asynchronous/non-blocking externals and explicitly locking externals. I'm not quite sure where to go with parallel programming and Pd (and I'm really not too knowledgable on the internals for dsp scheduling). I'd be interested to know what you do with threads in Pd and what you think about parallelism.
Chuck
On Tue, Oct 20, 2009 at 2:04 PM, patrick puredata@11h11.com wrote:
hi,
here's a pthread template that works for me: http://www.workinprogress.ca/pure-data-external-pthread-template/
pat
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd already does parallelism, but not using threads. It is
determinstic instead, meaning it will produce the exact same bit-for-
bit result everytime it runs. Its quite hard to make threaded
programs do that.
.hc
On Oct 27, 2009, at 2:26 PM, Charles Henry wrote:
Hi, Pat
It looks interesting, but I'm not sure yet how you use it. So, you write an external, and some of the routines can be wrapped up with (or called from) the pthread templates? Or do you take your routines and find/replace names to write your externals?
I've been studying parallel programming a lot lately, and it's given me some ideas for Pd, namely asynchronous/non-blocking externals and explicitly locking externals. I'm not quite sure where to go with parallel programming and Pd (and I'm really not too knowledgable on the internals for dsp scheduling). I'd be interested to know what you do with threads in Pd and what you think about parallelism.
Chuck
On Tue, Oct 20, 2009 at 2:04 PM, patrick puredata@11h11.com wrote:
hi,
here's a pthread template that works for me: http://www.workinprogress.ca/pure-data-external-pthread-template/
pat
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
I hate it when they say, "He gave his life for his country." Nobody
gives their life for anything. We steal the lives of these kids. -
Admiral Gene LeRocque
On Tue, Oct 27, 2009 at 02:52:38PM -0400, Hans-Christoph Steiner wrote:
Pd already does parallelism, but not using threads. It is determinstic instead, meaning it will produce the exact same bit-for-bit result everytime it runs. Its quite hard to make threaded programs do that.
The huge disadvantage being that you can't spread it over multiple cores. [pd~] is a pretty good solution but I worry about what will happen to Pd when there are 4096 CPUs in our machines. Dynamically patching 4096 [pd~] instances? [poly_pd~]? :D
Chris.
Hi Charles,
Since i needed to call libusb and it was causing a glitch in the DSP, i had to use pthread.
some of the routines can be wrapped up with (or called from) the pthread templates?
No, it's only a template (with a Makefile) as a starting point to code your own custom external. Maybe you should have a look at grh/threadlib/:
PD objects for threaded patching:
Also, i am not sure how good is my pthread template... I am not using sys_lock / unlock anywhere. It works, but maybe there's a huge mistake there.
patrick