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.
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
Using Python, write a simple application that takes user input of plaintext and key, and encrypt...
Using Python, write a simple application that takes user input of plaintext and key, and encrypt the plaintext with Vigenere Cipher. The application should then print out the plaintext and the ciphertext.
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).
Create any IOS mobile application using swift that can do the following A user should be...
Create any IOS mobile application using swift that can do the following A user should be able to see all uncompleted tasks in a UITableView • A user should be able to create new tasks • A user should be able to edit a task • A user should be able to mark a task as complete • A user should be able to see all completed tasks in a UITableView • A user should be able to close and...
Question 1 (10) Single screen with information about a the 2020 Olympics Create an application using...
Question 1 (10) Single screen with information about a the 2020 Olympics Create an application using PyQt. The user must enter the name of an Olympic sport and a single character (e.g ‘a’). The application must read the name of the sport and count the number of occurrences of the character in the sport 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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT