I writing a program creating a virtual circle with n
threads, they execute one by one, printing their id
and sending a signal to the next.
Basically, I need to create n number of threads, each receiving a
different parameter, zero to n-1, which is going
to be each threadís id. I need to create an array of cond_t variables
using malloc (n * sizeof (cond_t)). How do I make n number of threads?
Also, am I using malloc correctly?
This is the psuedo code I have so far:
malloc (n * sizeof (cond_t));
mutex_init (&mp, 0, NULL);
cond_init (&cp, 0, NULL);
thr_create(NULL, i, loop, (void *) NULL, NULL, NULL);
for(i = 0, i>n, i++)
if(id = 0)