Presentation is loading. Please wait.

Presentation is loading. Please wait.

CY2003 Computer Systems Lecture 11 Review Lecture.

Similar presentations


Presentation on theme: "CY2003 Computer Systems Lecture 11 Review Lecture."— Presentation transcript:

1 CY2003 Computer Systems Lecture 11 Review Lecture

2 © LJMU, 2004CY20032 Overview

3 Exam

4 © LJMU, 2004CY20034 Processes Four processes arrive at the same time in the order A B C D. A and D have priority 10 and B and C have priority 20; the highest priority is 0. A requires 10 ticks, B requires 15 ticks, C and D both require 20 ticks; the CPU quantum before a process is pre- empted is 5 ticks. The system uses Priority Queue scheduling. Ignoring any overhead for context switching between processes, calculate BOTH the average Waiting Time and average TurnAround Time. Explain why a priority-based mechanism is desirable for scheduling and why the priority of processes needs to be dynamically adjusted.

5 © LJMU, 2004CY20035 Semaphores A barbershop is designed so that there is a private room that contains the barber chair and an adjoining waiting room with a sliding door that contains N chairs. If the barber is busy, the door to the private room is closed and arriving customers sit in one of the occupied chairs. If a customer enters the shop and all chairs are occupied, the customer waits until a chair is available to sit in. If there are no customers to be served, the barber goes to sleep in the barber chair with the door to the waiting room open. If the barber is asleep, the customer wakes the barber and obtains a haircut. Use semaphores to write code fragments for barber and customer process that implement this synchronisation scheme. Explain your solution. This is a Producer/Consumer situation where the barber represents the Consumer.

6 © LJMU, 2004CY20036 Semaphores –shared int emptychairs = N –shared semaphore mutex = 1 –shared semaphore waitingCustomer = 0 –shared semaphore availChair = N Customerbarber while true { down (availChair); down(mutex); emptyChairs--; up (mutex); up (waitingCustomer); } while true { down (waitingCustomer); down (mutex); emptyChairs++; up (mutex); up (availChair); }

7 © LJMU, 2004CY20037 Semaphores Two types of process, A and B, must always run in the following order A B A B A B A B A B.... i..e. one instances of process type A followed by exactly one instance of process B. Produce a solution, based on semaphores, to the above problem.

8 © LJMU, 2004CY20038 Memory Management In a system with virtual memory, pages may either be resident in memory or in the swap area on disk. Identify what information needs to be maintained for the Page Table entry in each page. First In First Out (FIFO) is one possible algorithm for deciding what page to swap at any point. Compare and contrast any TWO OTHER algorithms which might be used.

9 © LJMU, 2004CY20039 File management An operating system supplies system calls to allow you to COPY, DELETE and RENAME a file. Discuss the differences between using COPY/DELETE RENAME To give a file a new name

10 © LJMU, 2004CY200310 Petri net Study the following properties on the markings graph and explain how you deduce them: –Conservativeness –Liveness –Safeness –Boundedness (k)


Download ppt "CY2003 Computer Systems Lecture 11 Review Lecture."

Similar presentations


Ads by Google