Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

 

image text in transcribed







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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Combinatorial Testing In Cloud Computing

Authors: Wei-Tek Tsai ,Guanqiu Qi

1st Edition

9811044805, 978-9811044809

More Books

Students also viewed these Programming questions

Question

5t-6, x 4 Given f(x)=x

Answered: 1 week ago