poly~ patch to C code, what's the method?

eliott paris's icon

Hello,
I've made a patch with poly~ and want now to move this patch in C world to make an external,
and i'm wondering what's the best or powerful method to adopt...
- can i simply create an array for each variable (size of each array depends of the number of poly~ instance) in my object structure,
and do a "for(int i = 0; i < numberOfPoly~Instance; i++)", who deals with those variables, directly inside my Dsp While?
am i in the good or wrong way? (notice that i have 64 instance in my initial poly~ patch).
2nd question :
- How (is it possible) to take advantage of the multi-threading in my C code? what's the method to implement it?

Thanks for reply.
Eliott.

andrea agostini's icon

Hi Elliott.

I'd say that yes, the way to go is a loop inside the perform routine. Then, according to the details of what you're doing, there might be room for some optimization...

About implementing multithreading, have a look here: https://cycling74.com/forums/question-about-ext_sysparallel-h

Cheers
aa

EDIT:
ps: don't forget to look into the simplethread and threadpool examples coming with the SDK!

eliott paris's icon

Thanks for reply Andrea, I'll make a try and read with more attention the post you mention about multithreading.

eliott