Docsity

Exam 1 Solution - Operating Systems - 2011 | COP 4600, Exams of Operating Systems

Toggle sidebar
bg1
1
This test is comprised of three different types of questions: multiple choice, true/false, and short
answer. If you need more room for some answers (for problems 23-28) use the backs of pages – label
all answers clearly if you do this!!!
Multiple choice - circle the number which corresponds to the best answer or best completes each
statement.
True or False - circle the word True if the statement is true and circle False if the statement is false.
Short answer – provide a short but complete answer to the question. Don’t write paragraphs. You
simply need to convince me that you know what’s going on with the concept on which the question is
based.
Problems 1-22 are worth 2 points each. Points for problems 23-25 are shown with the problem.
1. The primary goal of a modern operating system is (consider current perspective and not an
historical perspective):
(a) to manage the resources of the computer system in an efficient manner.
(b) to make the underlying hardware (the computer system) more convenient to use.
(c) to allow for multitasking of the CPU.
(d) to maintain a library of system calls and interrupt handlers to process jobs.
2. Which of the following is typically the critical performance requirement in an interactive (time-
sharing) operating system environment?
(a) Minimizing response time.
(b) Maximizing throughput.
(c) Minimizing the total number of interrupts that occur.
(d) None of the above are accurate.
COP 4600 – Exam #1 – Summer 2011
June 16, 2011
100 points total
Name:
(Please print clearly)
KEY
pf3
pf4
pf5
pf8

Partial preview of the text

Download Exam 1 Solution - Operating Systems - 2011 | COP 4600 and more Exams Operating Systems in PDF only on Docsity!

This test is comprised of three different types of questions: multiple choice, true/false, and short answer. If you need more room for some answers (for problems 23-28) use the backs of pages – label all answers clearly if you do this!!!

Multiple choice - circle the number which corresponds to the best answer or best completes each statement.

True or False - circle the word True if the statement is true and circle False if the statement is false.

Short answer – provide a short but complete answer to the question. Don’t write paragraphs. You simply need to convince me that you know what’s going on with the concept on which the question is based.

Problems 1-22 are worth 2 points each. Points for problems 23-25 are shown with the problem.

  1. The primary goal of a modern operating system is (consider current perspective and not an historical perspective): (a) to manage the resources of the computer system in an efficient manner. (b) to make the underlying hardware (the computer system) more convenient to use. (c) to allow for multitasking of the CPU. (d) to maintain a library of system calls and interrupt handlers to process jobs.
  2. Which of the following is typically the critical performance requirement in an interactive (time- sharing) operating system environment?

(a) Minimizing response time. (b) Maximizing throughput. (c) Minimizing the total number of interrupts that occur. (d) None of the above are accurate.

COP 4600 – Exam #1 – Summer 2011

June 16, 2011

100 points total

Name:

(Please print clearly)

KEY

  1. Consider the multi-level feedback uni-processor scheduling protocol. Which type of process is

favored by this protocol? (a) CPU-bound processes. (b) I/O-bound processes. (c) This protocol would favor neither CPU-bound nor I/O-bound processes.

  1. A standard “garden-variety” context-switch involves removing a running process from the CPU and replacing it with another process. Assuming that a dispatcher process is responsible for handling the context-switch and no interrupt handler is required for this context-switch, how many different “contexts” will the CPU see before the context-switch is completed?

(a) 2 (b) 3 (the original process, the dispatcher process, and the new process) (c) 4 (d) 6

  1. In problem #4, we assumed that no interrupt handler was involved in the context-switch. In this case, assume that an interrupt handler is involved with the context-switch (assume, for example, that the executing process requested some I/O service). Assuming that a dispatcher process is responsible for handling the context-switch, how many different “contexts” will the CPU see before the context-switch is completed? (a) 2 (b) 3 (c) 4 (the original process, the dispatcher process, the interrupt handler, and the new process) (d) 6
  2. The long-term scheduler is responsible for placing processes into the job pool (or process pool) based upon some selection protocol.

True False

  1. The short-term scheduler is responsible for removing processes from the ready list and placing them in the correct I/O device waiting queue.

True False

Explanation: If a process uses too much processor time (i.e., CPU- bound), it will migrate to lower priority queue levels. Thus, I/O-bound processes which use less CPU time (and thus have fewer context switches) will remain in the higher priority queue levels.

Explanation: If no interrupt handler is loaded then no context is loaded for it. Thus the only contexts will be the original process, the dispatcher process, and then the new process loaded by the dispatcher.

Explanation: In this case, the interrupt handler is a context that will be loaded, and thus one more context will be seen by the CPU.

  1. Dual-mode operation allows the OS to protect itself and other system components. The two

modes associated with dual mode operation are: (a) Protected mode and public mode (b) Internal mode and external mode (c) Passive mode and active mode (d) User mode and kernel mode

  1. The cache memory (if there is any at all) is invisible to the operating system.

True False

  1. One of the main advantages to the layered approach to OS design is:

(a) an overall increase in the functionality of the OS (b) interrupts are no longer necessary (c) the system can be constructed in a modular fashion (d) all of the above

  1. Which if the following is not a goal of uniprocessor scheduling?

(a) improve response time (b) increase processor efficiency (c) improve throughput (d) increase memory utilization

  1. Consider a system in which threads are supported only at the user level (the kernel is not threaded

and supports only processes). Suppose we have two processes, P1 consisting of a single thread and P2 consisting of 50 threads. Assuming that each process receives the same length time slice in the CPU, how much slower is a thread in P2 executed than the thread in P1? (a) 5 times slower (b) 50 times slower (c) 500 times slower (d) they execute at the same speed

Explanation: Both P1 and P2 receive the same overall time allocation in the CPU and P1 consists of a single thread and P2 consists of 50 threads. For P1 and P2 to execute in the same time, P2 would need to move all 50 threads through the CPU in the same time as the single thread of P1. Since this is not the case with equal CPU time allocations to P1 and P2, this means that a given thread in P2 will execute 50 times slower than the thread in P1.

  1. Which of the following is not a criterion commonly associated with uni-processor scheduling

protocols: a) CPU utilization b) response time c) waiting time d) none of the above

  1. General priority scheduling of the CPU suffers from which of the following problems:

a) aging b) deadlock c) starvation d) all of the above

  1. The SPN (Shortest Process Next) scheduling protocol prioritizes processes based upon the length of their expected service time. Since this basically means that you must predict the future, such a protocol cannot actually be implemented and is useful only as a theoretical tool.

True False

  1. General priority scheduling can lead to starvation (infinite blocking). To alleviate this problem many different solutions have been proposed including:

a) semaphores and monitors b) aging the process c) preemptive priority scheduling d) non-preemptive scheduling e) a, b, and c f) a, b, and d g) none of the above

  1. Processor scheduling techniques that use a feedback mechanism are basically penalizing processes

that have been executing for long periods of time, thus tending to prefer processes which have not been executing for long periods of time. True False

  1. (6 points) Explain the basic differences between preemptive and non-preemptive scheduling

protocols.

A non-preemptive algorithm allows a process, once assigned the CPU, to continue executing (complete its CPU burst) until it voluntarily leaves the running state (e.g., terminates or requests an I/O operation). Processes entering the ready queue do not have any impact on a running process.

A preemptive algorithm will take the CPU away from a running process if another process entering the queue better meets the qualifications of the algorithm (e.g., higher priority, shorter burst time). Processes entering the ready queue can affect a running process. Preemption reduces the waiting times for more important (better qualified) processes.

  1. (10 points) Diagram the simple five state process model (without the suspend states). Clearly

illustrate on your diagram how a process moves from one state to the next.

  1. (8 points) Explain the differences in long-term, medium-term, and short-term scheduling.

Long-term scheduling: The decision to add to the pool of processes to be executed. Executed rather infrequently compared with the other two schedulers.

Medium-term scheduling: The decision to add to the number of processes that are partially or fully in main memory. Basically controls the degree of multiprogramming. It is used primarily with time-sharing systems (not all systems will even have an intermediate scheduler). A swapping scheme is implemented to remove partially executed processes from the CPU (and memory) and reinstate them later at the point where they were interrupted.

Short-term scheduling: The decision as to which available process will be executed by the processor. Also known as the dispatcher.

  1. (8 points) Consider the process state model that includes suspended states. List and briefly

explain four (4) characteristics of a suspended process. In other words, every process in any suspended state will share these same characteristics.

  1. The process is not immediately available for execution.
  2. The process may or may not be waiting on an event. If it is, this blocked condition is independent of the suspend condition, and occurrence of the blocking event does not enable the process to be executed.
  3. The process was placed in a suspended state by an agent; either itself, a parent process, or the OS, for the purpose of preventing its execution.
  4. The process may not be removed from this state until the agent explicitly orders the removal.