Question

In: Computer Science

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 reasons behind your answers.

a. Thermostat in a household.

b. Control system for a nuclear power plant.

c. Fuel economy system in an automobile.

d. Landing system in a jet airliner.

Solutions

Expert Solution

1. Why there needs to be user thread and kernel thread?
Ans:
User Threads are managed by the user whereas opertaing sytem manages kernal level thread . In User mode the code execution cannot directly access the hardware which means that even in the worst case scenario our hardware is safe.Whereas kernel mode has unrestricted access to the underlying hardware, this means any code execution running at this mode has elevated permissions and access to the core system files.Thus this facility is provided to the OS only and in this way it also protects their internal data and hardware from any malicious code.

2-What are the advantages and disadvantages of writing an operating system in a highlevel language, such as C?
Ans:
Advantages:
a - High-level languages are easy to write and debug , thus they are programmer friendly.
b - It provide higher level of abstraction from machine languages.
c - They do not interact directly with the hardware. Rather, they focus more on the complex arithmetic operations, optimal program efficiency and easiness in coding.
d - They are machine independent language.

Disadvantages:
a - It takes additional translation times to translate the source to machine code.
b - High level programs are comparatively slower than low level programs.
c - They are less memory efficient
d - They cannot directly communicate to the hardware.

3. What is a critical section problem? Demonstrate that with an example.
Ans:
A critical section is the segment in the code where shared varialbles can be accessed .Thus, for a critical section it is required to check that only one process can execute at a time.All the other processes will have to wait.
The critical section problem is used to design a set of protocols which can ensure that the Race condition among the processes will never arise.
Image source : internet
Here, the entry and the exit section manages the critical part of the program.

4-With an example, show how critical section can led to dead locks.
Ans:
Lets say we have two resources R1 and R2 that comes under critical section area and only 1 process can be executed at a time.
Now , we have two processes P1 and P2:
P1 is accessing R1 and inside that it wants to access R2.
P2 is accessing R2 and inside that it wants to access R1.
Image source : Internet

Thus both process P1 and P2 we be in forever waiting phase which leads to a deadlock situation.

5 - Write two differences between a network OS and a distributed OS.
Ans:
Network OS:
a - Network OS provides services to its remote client ans communication is file based or shared folder based.
b - Network OS is highly scable and less fault tolerent.

Distributed OS:
a - Distributed OS manages hardware resources and communication is message based or shared memory based.
b - Distributed OS is less scalable and has vey high fault tolerance.



  


  


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.
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...
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...
1. What are first-mover advantages? Discuss these advantages. 2.  Explain the idea of a turnkey project. Why...
1. What are first-mover advantages? Discuss these advantages. 2.  Explain the idea of a turnkey project. Why should a firm use this arrangement to expand internationally? In what industries are turnkey arrangements most common?
What are the advantages of using personal interviews to determine employee needs? Why should these interviews...
What are the advantages of using personal interviews to determine employee needs? Why should these interviews be conducted without the presence of the employee’s supervisor?
Why is important to have posting guidance such as 1) avoiding duplicate thread titles, 2) creative...
Why is important to have posting guidance such as 1) avoiding duplicate thread titles, 2) creative subject lines, 3) avoiding heavy posting on Monday, 4) minimum word count, and 5) professional dialog through editing of posts? Minimum 100 Words
Why do kernel modules generally perform better than user-space device drivers? Name and define five sections...
Why do kernel modules generally perform better than user-space device drivers? Name and define five sections of the process space.
1. What are three risks and threats of the User Domain? 2. Why do organizations have...
1. What are three risks and threats of the User Domain? 2. Why do organizations have acceptable use policies (AUPs)? 3. Can Internet use and e-mail use policies be covered in an acceptable use policy? 4. Do compliance laws, such as the Health Insurance Portability and Accountability Act (HIPAA) or GLBA, play a role in AUP definition? 5. Why is an acceptable use policy not a fail-safe means of mitigating risks and threats within the User Domain?
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.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT