cop4600-sp08-quiz2Solutions

cop4600-sp08-quiz2Solutions - for up ( s ) if s.w is empty...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
COP4600 Operating Systems Solutions for Quiz 2 Prepared by Tuba Yavuz-Kahveci University of Florida tyavuz@cise.ufl.edu Questions There are two questions. Please read the questions carefully. Good luck! 1. (2.5 pts) In pseudocode write the algorithms for down and up operations on semaphore s . Assume that s.counter denotes the counter and s.w denotes the waiting list associated with s . You should also be using blocks and un- blocks phrases where appropriate. Pseudocode for down ( s ) if s.counter > 0 then s.counter = s.counter - 1 else block this process and add it to the end of s.w Pseudocode
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for up ( s ) if s.w is empty then s.counter = s.counter + 1 else remove the process at the head of s.w and unblock it 2. (2.5 pts) Write down the deFnitions of the following terms: (a) A CPU-bound process has relatively long CPU-bursts. (b) A I/O-bound process has relatively short CPU-bursts. (c) A non-preemptive scheduling algorithm lets a process run on the CPU until it blocks or terminates. (d) A preemptive scheduling algorithm may take away the CPU from a running process in the middle of its CPU-burst....
View Full Document

This test prep was uploaded on 04/18/2008 for the course COP 4600 taught by Professor Yavuz-kahveci during the Spring '07 term at University of Florida.

Ask a homework question - tutors are online