N is the number of threads that still have to reach the rendezvous point region is a mutex, protecting access to n bar1 and bar2 are semaphores, indicating the number of threads that can proceed, initialized to 0.
N is the number of threads that still have to reach the rendezvous point. Region is a mutex, protecting access to n. Bar1 and bar2 are semaphores, indicating the number of threads that can proceed, initialized to 0.In the first part of barrier(), each thread enters in turn, decreases n, and blocks on the bar1 semaphore.
The last thread to enter (the one that makes n == 0) posts the semaphore threads times, allowing that many threads to proceed. The second part is symmetrical to the first, this time waiting for the last thread to increment n.
Thank you! Now it's very clear... the key instruction was bar1.acquire(); which makes the thread which calls it to block. – shaku Mar 13 '11 at 19:28.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.