=========================preview======================
(COMP252)midterm00F_mkup_sol.pdf
Back to COMP252 Login to download
======================================================
COMP 252 Principles of Systems Software
Fall semester 2000
Mid-Term Examination
Date: October 22, 2000 Time: 1:00pm-3:00pm
SOLUTION
Name: Student ID: Email:
Instructions:
1.
This examination paper consists of 8 pages and 6 questions.
2.
Please write your name, student ID and Email on this page.
3.
For each subsequent page, please write your student ID at the top of the page in the space provided.
4.
Please answer all the questions within the space provided on the examination paper. You may use the back of the pages for your rough work.
5.
Please read each question very carefully and answer the question clearly and to the point. Make sure that your answers are neatly written, readable and legible.
6.
Show all the steps you use in deriving your answer, wherever appropriate.
7.
For each of the questions assume that the concepts are known to the graders. Concentrate on answering to the point what is asked. Do not define or describe the concepts.
Question Points Score
1 10
2 10
3 20
4 20
5 20
6 20
TOTAL 100
1a. Explain briefly the difference between the job queue and the ready queue.
-Job queue is keeping the jobs on the disk which are submitted to the system but which are not running yet.
-Ready queue is keeping processes/threads which are loaded into the memory and which have started their execution.
1b. Explain briefly the difference between multiprogramming and time-sharing.
In multiprogramming a process is holding a CPU until it needs some I/O operation or waits for an event.
In time-sharing a process can hold a CPU up to the size of the time-slice (quantum) or until it asks for an I/O (event) whichever comes first.
1c. Explain briefly the difference between spinlock semaphores and semaphores with no busy-waiting.
Spinlock semaphores use busy waiting. There is no context switch (except for the timer inter-rupt) when a process must wait on a lock. They are used when locks are expected to be held for a short time.
Semaphores without busy waiting put the calling thread/process on the waiting list if the of the sempahore was 0 at the moment when P() operation was invoked.
1d. Explain briefly the difference between the user level thread and the traditional process.
Multiple threads can execute in a single address space so that sharing of resources and data is easy. Creation and deletion of threads is much less expensive.
However, threads running in the same address space may interfere with one another if not properly synchronized.
2. Explain briefly the following concepts in not more than two sentences each. a) Mutual exclusion in the Critical Section Problem b) Aging c) Blocking a process d) Context switching e) Non-preemptive scheduling
a) If multiple processes need to acces a critical section, they can do this only one process at a time.
b) Process which has spent a lot of CPU time will be penalized by decreasing its prior