How can I parallize using pthread

Hi all,

How can i parallize this code in pthread?

for(round=1;round<=16;round++)
{
Expansion(mid, 17 - round - 1, left); 
Expansion(mid, round - 1, right); 
round++;
Expansion(right, 17 - round - 1, mid); 
Expansion(left, round - 1,mid); 
 
}

Whereby each loop depend on the previous result from the first loop...

Thanks & Regards
[/SIZE]

Can you provide the code for Expansion() so we can see what this function is doing?

I don't think pthreads() will help you here regardless, especially if Expansion is relatively quick. It also looks as if each iteration of the loop depends on the completion of the previous iteration. So it probably makes more sense to parallelize an outer loop (the one you have not shown us).