In C, multicore function declaration question
In the tutorial C - Functions Multicore Example, the following is used to declare and define the function that is used in the new cog:
void adder(void *par);
I've looked through some of the c-libraries and see the same parameter when starting a function in a new cog. From reading my C text (void *par) is an untyped pointer to par. What does that do in relation to the function in the new cog? Is par a reserved variable name that is used any time a function is started in a different cog? In other words, if I am starting a different function in each of 3 cogs, would I use (void *par) as the parameter for each function?
Related question: Can I pass other parameters to a cog in a function call? If so what does the declaration of the function look like, and is void *par still one of the parameters?
Thanks again
Tom
void adder(void *par);
I've looked through some of the c-libraries and see the same parameter when starting a function in a new cog. From reading my C text (void *par) is an untyped pointer to par. What does that do in relation to the function in the new cog? Is par a reserved variable name that is used any time a function is started in a different cog? In other words, if I am starting a different function in each of 3 cogs, would I use (void *par) as the parameter for each function?
Related question: Can I pass other parameters to a cog in a function call? If so what does the declaration of the function look like, and is void *par still one of the parameters?
Thanks again
Tom

Comments
The name par is not special; it's just a declaration. It can be called "MarilynMonroll" if you like - a most interesting Sushi dish in Rocklin.
Some examples (code has not been test compiled):
int stack[200/4]; // 200 bytes of stack should be global. volatile int parnum = 10; // par should be volatile to keep compiler from optimizing away code. volatile int pararray[4]; typedef struct mystruct { volatile int request; volatile int response; } MyST; MyST *parstvar; void adder1(void* num) { int number = (int) num; } void adder2(void* numptr) { int number = *(int*) numptr; } void adder3(void* array) { int n; int *myArray = (int*) array; for(n = 0; n < 4; n++) { myArray[n] = n; } } void adder4(void* stptr) { MyST sp = (MyST*) stptr; } int main(void) { cogstart(adder, (void*) parnum, &stack, sizeof(stack)); // passes the value in parnum to the function - not recommended. cogstart(adder, &parnum, &stack, sizeof(stack)); // passes the address of parnum to the function. cogstart(adder, ¶rray[0], &stack, sizeof(stack)); // passes the address of pararray[0] to the function. cogstart(adder, &parstvar, &stack, sizeof(stack)); // passes the address of pararray[0] to the function. return 0; }Reference: https://sites.google.com/site/propellergcc/documentation/libraries/propeller-h-library#TOC-cogstarthttp://www.tymkrs.com/shows/episode/firstc-episode-011/