A. Fill each entry in the following table with Yes or No for the example program in

Question:

A. Fill each entry in the following table with “Yes” or “No” for the example program in Figure 12.15. In the first column, the notation v.t denotes an instance of variable v residing on the local stack for thread t , where t is either m (main thread), p0 (peer thread 0), or p1 (peer thread 1).

Variable instance ptr cnt i.m msgs.m myid.po myid.pl main thread? Referenced by peer thread 02 peer thread 1?

B. Given the analysis in part A, which of the variables ptr, cnt, i, msgs, and
myid are shared?

Figure 12.15

1 #include "csapp.h" 2 #define N 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Systems A Programmers Perspective

ISBN: 9781292101767

3rd Global Edition

Authors: Randal E. Bryant, David R. O'Hallaron

Question Posted: