I am trying to understand pthreads by example. I have made the following code that is giving different answers everytime I run! Could anyone explain the bug please? TIA, Svi
Ok, finally added the extracode as suggested by the experts and it works fine now. Thanks again to all. :)
for ( t = 0; t < NUM_THREADS; t++ ) { (void) pthread_join(threads[t], NULL); }