CS111—Operating System Principles



UNI CS 3430

Operating Systems

Suggested Exercises 2

Note: The point of the exercises is to help you reflect on and better understand the course material for the test. This material and types of questions will probably show up on the exams. We will go over answers to the questions before the exam. Covers Sessions 3, 4, and 5.

Vocabulary to know [Session 3]: Multiprocessing, multithreading, multitasking, multiprogramming, uniprogramming, program, thread, address space, process, dispatching loop

Vocabulary to know [Session 4]: fork, execvp, waitpid, zombie

Vocabulary to know [Session 5]: Starvation, preemptive vs. nonpreemptive scheduling, FIFO, RR, SJN, SRTF, time slice/quantum, multilevel feedback queues, lottery scheduling

Questions and Short Answers:

1. [Session 3] Find a creative/funny analogy to distinguish between a process and a program.

2. [Session 3] Give an example where a uniprogramming environment is appropriate.

3. [Session 3] What is the difference between multithreading and running multiple single-threaded processes?

4. [Session 3] Can you draw out the thread state diagram (last slide) without looking at it? Does it make sense for a blocked thread to transition directly to the running state?

4. [Session 5] Suppose we have three processes.

|Process ID |Required CPU time |Arrival Time |

|A |200 msec |50 msec |

|B |400 msec |150 msec |

|C |300 msec |0 msec |

a) Draw the execution timeline for the FIFO scheduling policy, and compute the average response time, average wait time, and average turnaround time. Please show your work.

b) Assume the time slice of 100 msec and a zero context-switching cost. Draw the execution timeline for the round-robin scheduling policy, and compute the average response time, average wait time, and average turnaround time. Please show your work.

c) Draw the execution timeline for the SJF scheduling policy, and compute the average response time, average wait time, and average turnaround time. Please show your work.

d) Draw the execution timeline for the SRTF scheduling policy, and compute the average response time, average wait time, and average turnaround time. Please show your work.

5. [Session 5 - Do you really get it?] For each scheduling strategy mentioned in class (FIFO, RR, SJF, SRTF, multi-level feedback queues, lottery scheduling), find creative/funny examples in life, where the scheduling strategy works and fails.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download

To fulfill the demand for quickly locating and searching documents.

It is intelligent file search solution for home and business.

Literature Lottery

Related searches