pthread_loop.c running creating thread 0 creating thread 1 creating thread 2 creating thread 3 waiting for threads to reach first barrier in barrier nb=1 of np=5 about to cond wait thread 0 at first barrier, iloop 5014720 in barrier nb=2 of np=5 about to cond wait thread 1 at first barrier, iloop 0 in barrier nb=3 of np=5 about to cond wait thread 2 at first barrier, iloop 0 in barrier nb=4 of np=5 about to cond wait thread 3 at first barrier, iloop 0 in barrier nb=5 of np=5 about to broadcast thread 3 running after first barrier, iloop 0 thread 3 at second barrier, iloop 0 in barrier nb=1 of np=5 about to cond wait thread 0 running after first barrier, iloop 0 thread 0 at second barrier, iloop 0 in barrier nb=2 of np=5 about to cond wait thread 1 running after first barrier, iloop 0 thread 1 at second barrier, iloop 0 in barrier nb=3 of np=5 about to cond wait all threads finished first task results[0]=10 results[1]=20 results[2]=0 results[3]=40 wait for all threads to finish second task in barrier nb=4 of np=5 about to cond wait thread 2 running after first barrier, iloop 0 thread 2 at second barrier, iloop 0 in barrier nb=5 of np=5 about to broadcast thread 2 running after second barrier, iloop 0 thread 2 at third barrier, iloop= in barrier nb=1 of np=5 about to cond wait thread 3 running after second barrier, iloop 0 thread 3 at third barrier, iloop= in barrier nb=2 of np=5 about to cond wait thread 0 running after second barrier, iloop 0 thread 0 at third barrier, iloop= in barrier nb=3 of np=5 about to cond wait all threads finished second task final results[0]=110 final results[1]=20 final results[2]=330 final results[3]=440 wait for all threads to finish third task in barrier nb=4 of np=5 about to cond wait thread 1 running after second barrier, iloop 0 thread 1 at third barrier, iloop= in barrier nb=5 of np=5 about to broadcast thread 1 running after third barrier, iloop 0 thread 1 at fourth barrier, iloop 0 in barrier nb=1 of np=5 about to cond wait thread 2 running after third barrier, iloop 0 thread 2 at fourth barrier, iloop 0 in barrier nb=2 of np=5 about to cond wait thread 3 running after third barrier, iloop 0 thread 3 at fourth barrier, iloop 0 in barrier nb=3 of np=5 about to cond wait all threads finished third task in barrier nb=4 of np=5 about to cond wait thread 0 running after third barrier, iloop 0 thread 0 at fourth barrier, iloop 0 in barrier nb=5 of np=5 about to broadcast thread 0 running after first barrier, iloop 1 thread 0 at second barrier, iloop 1 in barrier nb=1 of np=5 about to cond wait thread 1 running after first barrier, iloop 1 thread 1 at second barrier, iloop 1 in barrier nb=2 of np=5 about to cond wait thread 2 running after first barrier, iloop 1 thread 2 at second barrier, iloop 1 in barrier nb=3 of np=5 about to cond wait final results[0]=11 final results[1]=21 final results[2]=31 final results[3]=4440 all threads finished first task results[0]=11 results[1]=21 results[2]=31 results[3]=4440 wait for all threads to finish second task in barrier nb=4 of np=5 about to cond wait thread 3 running after first barrier, iloop 1 thread 3 at second barrier, iloop 1 in barrier nb=5 of np=5 about to broadcast thread 3 running after second barrier, iloop 1 thread 3 at third barrier, iloop= in barrier nb=1 of np=5 about to cond wait thread 0 running after second barrier, iloop 1 thread 0 at third barrier, iloop= in barrier nb=2 of np=5 about to cond wait thread 1 running after second barrier, iloop 1 thread 1 at third barrier, iloop= in barrier nb=3 of np=5 about to cond wait all threads finished second task final results[0]=111 final results[1]=221 final results[2]=31 final results[3]=441 wait for all threads to finish third task in barrier nb=4 of np=5 about to cond wait thread 2 running after second barrier, iloop 1 thread 2 at third barrier, iloop= in barrier nb=5 of np=5 about to broadcast thread 2 running after third barrier, iloop 1 thread 2 at fourth barrier, iloop 1 in barrier nb=1 of np=5 about to cond wait thread 3 running after third barrier, iloop 1 thread 3 at fourth barrier, iloop 1 in barrier nb=2 of np=5 about to cond wait thread 0 running after third barrier, iloop 1 thread 0 at fourth barrier, iloop 1 in barrier nb=3 of np=5 about to cond wait all threads finished third task in barrier nb=4 of np=5 about to cond wait thread 1 running after third barrier, iloop 1 thread 1 at fourth barrier, iloop 1 in barrier nb=5 of np=5 about to broadcast final results[0]=1111 final results[1]=2221 final results[2]=3331 final results[3]=4441 master exiting