Question: a. Describe three applications where multi-threading can lead to improved performance over a single-threaded application. b. Could you implement a shell using 'pthread_create()' and 'pthread_join()'(i.e.,

a. Describe three applications where multi-threading can lead to improved performance over a single-threaded application. b. Could you implement a shell using 'pthread_create()' and 'pthread_join()'(i.e., a multi-threaded shell) as opposed to fork()', 'exec()' and 'wait()'? If yes, explain how. If not, explain why. c. Why is it much less costly to switch between two threads that are part of the same process than between two threads where each of the threads is part of a different process? d. Why does each thread require its own stack? What would happen if there was only one stack and more than one thread in a process? e. What is a race condition'? Give an example that contains a potential race condition. Describe conditions under which the race condition could occur
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
