Question: #include #include #include #include void *go(void *); #define NTHREADS 20 pthread_t threads[NTHREADS]; int main() { int i; for (i = 0; i < NTHREADS; i++)
#include
The function go() in the program in Step 1 has the parameter arg passed a local variable. Is the variable per thread variable or a shared state? Where does the compiler store the variables state?
The main() in the program in Step 1 has local variable i. Is this variable per thread variable or a shared state? Where does the compiler store this variable?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
