Question: int count = 0; output of the following program. void *AddByOne (void *arg) { count = count + 1; } void main() { pthread_t

int count = 0; output of the following program. void *AddByOne (void *arg) { count = count + 1; } void main() { pthread_t tid1, tid2; pthread_create(&tid1, NULL, &AddByOne, NULL); pthread_create(&tid2, NULL, &AddByOne, NULL); pthread_join(tid1); pthread_join(tid2); printf("Count } = %d ", count);
Step by Step Solution
There are 3 Steps involved in it
The given program creates two threads tid1 and tid2 which both call the AddByOne function The AddB... View full answer
Get step-by-step solutions from verified subject matter experts
