In reply to pawan:
Pawan,
If int j=i, and thread3(j) is not used, then it results in calling thread3(32) 32 times in parallel and will not meet your purpose.
Dave,
Shouldn’t the variable ‘j’ declaration be automatic here? (automatic int j = i;)
Otherwise we will hit the same issue again, Is my understanding correct?