Question

In: Computer Science

Threads: Assume a multithreaded application using user level threads mapped to a single kernel level thread...

Threads: Assume a multithreaded application using user level threads mapped to a single kernel level thread in one process (Many to one model). Describe the details of what happens when a thread (i.e. thread 1) executes a blocking system call (5 points). Describe what happens when thread 1 yields control to another user level thread, namely thread 2, in the same process. (NOTE: include the following in your description: what state is saved?, where is it saved? What state is restored right after saving current context?, etc)

Thread 1 blocking system call:

Thread 1 to thread 2 ctsw

Solutions

Expert Solution

Assuming a multithreaded application using user level threads mapped to a single kernel level thread in one which is

a Many to one multithreading model.

1.In Many to one multithreading model ,When thread 1 executes a blocking system call, the entire process will be blocked, Only one thread can access the kernel at a time , so multiple thread are unable to run in parallel on multiprocessors.

2.When thread 1 yields control to another user level thread which is thread then the CPU switches form executing thread 1 to execute another, the CPU needs to save the state of the thread which is nothing but local data,program pointer etc. of the thread 1 and load or restore the local data, program pointer etc. of the thread 2 to execute. which is called Context Switching Overhead.SInce in many to one mutlithreading model only one thread can access the kernel at a time so thread 2 can access the kernel but now thread 1 can't access the kernel at the same time.


Related Solutions

Name one advantage of associating user threads with kernel thread? Suggest an advantage and disadvantage of...
Name one advantage of associating user threads with kernel thread? Suggest an advantage and disadvantage of using mailboxes over shared memory for inter-process communication.
In what ways are user-level threads better/more efficient than kernel-level threads? In what ways are they...
In what ways are user-level threads better/more efficient than kernel-level threads? In what ways are they less efficient?
1.What are two differences between user-level threads and kernel-level threads? Under what circumstances is one type...
1.What are two differences between user-level threads and kernel-level threads? Under what circumstances is one type better than the other? 2.Describe the actions taken by a kernel to context switch between kernel level threads. 3.What resources are used when a thread is created? How do they differ from those used when a process is created? 4.Provide two programming examples in which multithreading provides better performance than a single-threaded solution.    5.Assume an operating system maps user-level threads to the kernel using...
1. Why there needs to be user thread and kernel thread? 2. What are the advantages...
1. Why there needs to be user thread and kernel thread? 2. What are the advantages and disadvantages of writing an operating system in a highlevel language, such as C? 3. What is a critical section problem? Demonstrate that with an example. 4. With an example, show how critical section can led to dead locks. 5. Write two differences between a network OS and a distributed OS. 6. Identify the following environments as hard, firm or soft real time. Give...
Which of the methods used to map user threads to kernel threads can exploit a multiprocessor...
Which of the methods used to map user threads to kernel threads can exploit a multiprocessor environment? Justify your answer
Which of the methods used to map user threads to kernel threads can exploit a multiprocessor...
Which of the methods used to map user threads to kernel threads can exploit a multiprocessor environment? Justify your answer.
Thread scheduling at the process level and at the kernel level. This topic requires more work...
Thread scheduling at the process level and at the kernel level. This topic requires more work on my part and I will give an updated draft. There may be more than one question here. Review the different allocation policies for kernel threads in relation to user threads – one to one, many to one, many to many, hybrid. These are sometimes referred to as an “M:N ratio” where M is the number of user threads and N is the number...
Assume that an average user of an iPhone application buys a plan that is worth $80....
Assume that an average user of an iPhone application buys a plan that is worth $80. They tend to repeat this purchase two more times. And our profit margin is 25%. Develop a calculation to calculate the life time value of a user? please show detailed steps of your calculations
Create an application using PyQt. The user must be prompted for the name of a country...
Create an application using PyQt. The user must be prompted for the name of a country (e.g. Spain) and a single character (e.g ‘a’). The application must read the name of the country and count the number of occurrences of the character in the country name. The count should be case-insensitive. Thus, if ‘c’ is entered as the character then both capital letter ‘C’ and small letter ‘c’ in the string should be counted. The count must be displayed. The...
Let's assume that, an application program calls a High Level Language library function to display a...
Let's assume that, an application program calls a High Level Language library function to display a string with red color in the monitor. Explain the steps executing the operation (from function call to low hardware level).
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT