Question: The program shown in Figure 4 . 2 3 uses the Pthreads API. What would be the autput from the program at LINE C and

The program shown in Figure 4.23 uses the Pthreads API. What would be the autput from the program at LINE C and LINE P?
finclude
#include
int value =0;
void runner (void param); /* the thread */ ant sain (int arge, char *argv])
padt pid; pthread.t tid; pthread attrt attr;
pid = fork;
if (pid =0){/* child process */
pthread attrinit (dattr);
tread create tid, attr, runner, NULL) ; pthread join (tid, NULL);
prints (CHTLD: value =", value); /* LINE C / else if (pid 0)\/ parent process */
sait (NULL) ;
printi ("PARENT: value =%d"
, value); /* LINE P */
void runner (void *param)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!