







































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








































Parallel Software Slides adapted from the lecture notes by Peter Pacheco
printf ( "Thread %d > my_val = %d\n" , my_rank , my_x ) ;
... Thread 0 > my_val = 7 Thread 1 > my_val = 19 Thread 1 > my_val = 19 Thread 0 > my_val = 7 The same input can result in different output.
my_val = Compute_val ( my_rank ) ; i f ( my_rank == 1) whi l e (! ok_for_1 ) ; /* Busy−wait loop / x += my_val ; / Critical section / i f ( my_rank == 0) ok_for_1 = true ; / Let thread 1 update x */
Tserial Tparallel
Tserial