Question: 1 ## ./code 2 Hello from thread 0 3 Hello from thread 1 4 Hello from thread 2 5 Hello from thread 3 6 Hello

Given the content of a C source file named "code.c" 1 #include

1 ## ./code 2 Hello from thread 0 3 Hello from thread 1 4 Hello from thread 2 5 Hello from thread 3 6 Hello from thread 4 7 Hello from thread 5 8 Hello from thread 6 9 Hello from thread 7 10 Hello from thread 8 11 Hello from thread 9

 

2 #include 3 void hello (void tid) { 4 5} printf("Hello_from_thread %d







Given the content of a C source file named "code.c" 1 #include 2 #include 3 void hello (void tid) { 4 5} printf("Hello_from_thread %d ", (int) tid); 6 int main() { 7 8 pthread_t tid [10]; int i; for (i=0; i < 10; i++) { 9 10 11 } 12 13} pthread_create(&tid [i], NULL, hello, (void)i); pthread_exit (NULL);

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 Programming Questions!