Question: Answer these questions using this link: https://computing.llnl.gov/tutorials/pthreads/exercise.html RATINGS WILL BE GIVEN 1. Thread Scheduling: 1. Review the example code hello32.c. Note that it will create

Answer these questions using this link: https://computing.llnl.gov/tutorials/pthreads/exercise.html RATINGS WILL BE GIVENAnswer these questions using this link: https://computing.llnl.gov/tutorials/pthreads/exercise.html RATINGS WILL BE GIVEN 1.Thread Scheduling: 1. Review the example code hello32.c. Note that it will

1. Thread Scheduling: 1. Review the example code hello32.c. Note that it will create 32 threads. A sleep); statement has been introduced to help insure that all threads will be in existence at the same time. Also, each thread performs actual work to demonstrate how the OS scheduler behavior determines the order of thread completion. 2. Compile and run the program. Notice the order in which thread output is displayed. Is it ever in the same order? How is this explained? 2. Argument Passing Review the hello_arg1.c and hello_arg2.c example codes. Notice how the single argument is passed and how to pass multiple arguments through a structure. Compile and run both programs, and observe output. Now review, compile and run the bug3.c program. What's wrong? How would you fix it? 3. Thread Exiting Review, compile (for gcc include the -Im flag) and run the bug5.c program. What happens? Why? How would you fix it? 1. Thread Scheduling: 1. Review the example code hello32.c. Note that it will create 32 threads. A sleep); statement has been introduced to help insure that all threads will be in existence at the same time. Also, each thread performs actual work to demonstrate how the OS scheduler behavior determines the order of thread completion. 2. Compile and run the program. Notice the order in which thread output is displayed. Is it ever in the same order? How is this explained? 2. Argument Passing Review the hello_arg1.c and hello_arg2.c example codes. Notice how the single argument is passed and how to pass multiple arguments through a structure. Compile and run both programs, and observe output. Now review, compile and run the bug3.c program. What's wrong? How would you fix it? 3. Thread Exiting Review, compile (for gcc include the -Im flag) and run the bug5.c program. What happens? Why? How would you fix it

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