Question: void * mythread ( void * arg ) { printf ( % s , ( char * ) arg ) ; return Null;
void mythreadvoid arg
printfs
char arg;
return Null;
int
mainint argc, char argv
pthreadt p p;
int rc;
printfmain: begin
;
Pthreadcreate&p NULL, mythread, A;
Pthreadcreate&p NULL, mythread, B;
Pthreadjoinp NULL;
Pthreadjoinp NULL;
printfmain: end
;
return ;
Above C program starts off two worker threads P and P to print out a letter A and B respectively. If the two lines highlighted in RED are removed, what is likely to happen compared with the output of existing program?
thread p and p will not be started
Letter A or B will be printed in indeterministic order
Both A and B are printed, or either A or B is printed, or neither is printed.
"main: end" will notbeprintedout
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
