CS 372 Operating Systems
Homework 1: Processes,
Scheduling, Threads, Synchronization
Due: Tuesday September 29, at the start of class
- Processes. What differentiates a program, an
executable, and a process?
- Process creation. Write a C/C++ program in which a
parent forks a child, and the child forks a grandchild. The
grandchild writes: "My process id is X, my parent's id is Y, and my
Grandparent's id is Z" (where X, Y, and Z are the Unix process
ids), and no other process writes.
- Scheduling. How can fairness and
throughput be competing goals for a scheduler? Give an example
where a
fair scheduler makes bad use of the CPU, and an example where a
high-throughput scheduler is unfair.
- Scheduling. Which of MLFQ and approximate SJF that
you implemented in lab1 approximates the ideal SJF better and why.
- Scheduling. MLFQ prioritizes jobs based on how
frequently they perform I/0. Describe an algorithm to add to the
3-queue MLFQ from lab 1 a secondary
priority criteria (e.g., give priority to OS processes, certain users,
or certain
processes such as video.)
-
Scheduling (from Silberchatz). Consider a preemptive priority
scheduling algorithm based on dynamically changing
priorities. Larger priority numbers imply higher
priority. When a process is waiting for the CPU (in the ready
queue but not running), its priority changes at the rate 'A';
when its running its priority changes at the rate 'B'. All
processes are given a priority of 0 when they enter the ready
queue. What's the algorithm that results from
a. B > A > 0?
b. A < B < 0?
and why?