Compare the use of monitor and semaphore operations define


Assignment 1:

1. Describe how multithreading improve performance over a singled-threaded solution.

2. Provide two programming examples of multithreading giving improved performance over a single-threaded solution.

3. Provide two programming examples of multithreading that would not improve performance over a single-threaded solution.

4. Why thread is necessary? What are the two differences between the kernel level threads and user level threads? Which one has a better performance?

5. List the differences between processes and threads.

6. What resources are used when a thread is created? How do they differ from those used when a process is created?

7. Describe the actions taken to context switch between threads.

8. If a multithreaded process forks, a problem occurs if the child gets copies of all the parent's threads. Suppose that one of the original threads was waiting For keyboard input. Now two threads are waiting for keyboard input, one in each process. Does this problem ever occur in single-threaded processes?

9. Why would a thread ever voluntarily give up the CPU by calling thread_yield? After all, since there is no periodic clock interrupt, it may never get the CPU back.

10. In a system with threads, is there one stack per thread or one stack per process when user-level threads are used? What about when kernel threads are used? Explain.

Assignment 2:

1. What is race condition?

2. When a computer is being developed, it is usually first simulated by a program that runs one instruction at a time. Even multiprocessors are simulated strictly sequentially like this. Is it possible for a race condition to occur when there are no simultaneous events like this?

3. Does the busy waiting solution using the turn variable (fig.2-20) work when the two processes are running on a shared-memory multiprocessor, that is, two CPUs, sharing a common memory?

4. Does Peterson's solution to the mutual exclusion problem shown in Fig 2-21 work when process scheduling is preemptive? How about when it is non- preemptive?

5. Consider a computer that does not have a TSL instruction but does have an instruction to swap the contents of a register and a memory word in a single indivisible action. Can that be used to write a routine enter_region such as the one found in fig. 2-22?

6. Give a sketch of how an operating system that can disable interrupts could implement semaphores?

7. What is the meaning of busy waiting? What others kinds of waiting are in OS? Compare each type on their applicability and relative merits.

8. Show the Peterson's algorithm preserve mutual exclusion, indefinite postponement and deadlock.

9. Compare the use of monitor and semaphore operations.

10. Define Semaphore. How does semaphore help in dinning philosopher problem. Explain.

11. Draw and describe the 3-state process model.

12. What is the problem with thread implementation in User Space when any one of the threads gets blocked while performing IO operation?

13. "Using Semaphore is very critical for programmer" Do you support this statement? If yes prove the statement with some fact. If not, put your view with some logical facts against the statement.

14. What is critical section problem? Why executing critical section must be mutual exclusive? Explain.

Request for Solution File

Ask an Expert for Answer!!
Operating System: Compare the use of monitor and semaphore operations define
Reference No:- TGS02633040

Expected delivery within 24 Hours