Question: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | /* * ===================================================================================== * * Filename: hello_world.c * * Description: This file demonstrates the use of POSIX threads - A hello world program * * Version: 1.0 * Created: 11/03/2020 07:50:04 AM * Revision: none * Compiler: gcc * * Author: ABHISHEK SAGAR (), * Organization: Juniper Networks * * ===================================================================================== */ /* * compile using : * gcc -g -c hello_world.c -o hello_world.o * gcc -g hello_world.o -o hello_world.exe -lpthread * Run : ./hello_world.exe */ #include |
please do it in cygwin using unix
Create a homework solution document (.pdf) that contains the answers to the following questions: a. What does this code do? b. Why do we need to include stdio.h? c. Why do we need to include "pthread.h? d. How would you change this code so that it creates exactly 10 new threads after the main thread starts? e. How would you change this code so that the main thread dies before any new threads are created? f. What can be guaranteed about which printf calls happen in which order? g. Under what circumstances would the error on line 68 get printed out? Compile the code in hello_world_thread.c to create an executable called "hello_world_thread. Demonstrate that you have successfully compiled and run the code, either through a combination of texts and screenshots, or by creating a video. Add this proof to your homework solution document. Change the code so that it creates exactly 10 new threads after the main thread starts. Compile and run the code to show that you have done this successfully. Add this proof to your homework solution document. Change the code so that the main thread dies before it can create any new threads. Compile and run the code to show that you have done this successfully. Add this proof to your homework solutions document. Create a homework solution document (.pdf) that contains the answers to the following questions: a. What does this code do? b. Why do we need to include stdio.h? c. Why do we need to include "pthread.h? d. How would you change this code so that it creates exactly 10 new threads after the main thread starts? e. How would you change this code so that the main thread dies before any new threads are created? f. What can be guaranteed about which printf calls happen in which order? g. Under what circumstances would the error on line 68 get printed out? Compile the code in hello_world_thread.c to create an executable called "hello_world_thread. Demonstrate that you have successfully compiled and run the code, either through a combination of texts and screenshots, or by creating a video. Add this proof to your homework solution document. Change the code so that it creates exactly 10 new threads after the main thread starts. Compile and run the code to show that you have done this successfully. Add this proof to your homework solution document. Change the code so that the main thread dies before it can create any new threads. Compile and run the code to show that you have done this successfully. Add this proof to your homework solutions document
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
