Electrical, Computer, and Systems Engineering
ECSE-4730 Computer Systems Architecture
Fall 1998
Problem Set 5/6-- Due MONDAY, November 23, 1998
|
Your Name |
|
|
Circle Your Section |
8-9:50 am 10-11:50 am noon-1:50pm |
Notes:
----------------------------------Do not write below this line-----------------------------------------
|
1 |
2 |
3 |
Total |
|
10 |
25 |
15 |
50* |
*Note: all homeworks will be normalized and equally weighted.
TA Signature :___________________________________
A) (2 pts) What is multiprogramming ?
Supporting the illusion of multiple programs using a single CPU at once.
B) (6 points) State how the following operating system concepts are used to support multiprogramming ?
Processes & Threads: A process is a program in execution. The OS switches CPU among multiple processes. Threads reduce the context switching overhead.
Virtual memory: Virtual memory allows multiple processes to be resident in memory even if only a part of their address space is physically stored in memory
Mailbox: Mailbox allows asynchronous communication between multiple processes, enabling processes to cooperate on tasks.
C) (2 pts) What issues arise from the need to support multi-user environments and interactive (time-sharing) environments ?
Multi-user: protection and sharing issues
Interactive: optimizing response times in addition to throughput
A) (6 pts) Define:
CPU-burst cycle and I/O burst cycle: Typical process execution proceeds as an alternating cycle of CPU bursts when it needs the CPU, and I/O bursts when it does I/O.
Preemptive scheduling: A process can be moved from CPU (running state) to ready state before the end of its current CPU burst.
Non-preemptive scheduling: A process which gets control of CPU (running state) releases it only when it finishes its CPU burst (moves to waiting state) or terminates.
Utilization vs Throughput : Utilization measures CPU activity (both user and system tasks) whereas throughput measures number of only completed user tasks per second.
Turnaround vs waiting time : Turnaround time is the total time spent in system by a process (start to finish) while waiting time measures only time spent in the ready queue.
Process Burst time Priority
P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2
The processes have arrived in the order P1, P2, P3, P4, P5, all at time 0.
0 10 11 13 14 19
(P1) (P2) (P3) (P4) (P5)
0 1 2 4 9 19
(P2) (P4)(P3) (P5) (P1)
0 1 6 16 18 19
(P2) (P5) (P1) (P3) (P4)
P1 P2 P3 P4 P5 P1 P3 P5 P1 P5 P1 P5 P1 P5 P1 P1 P1 P1 P1
FCFS: P1 = 0, P2 = 10, P3 = 11, P4 = 13, P5 = 10
SJF: P1 = 9, P2 = 0, P3 = 2, P4 = 1, P5 = 4
Priority: P1 = 6, P2 = 0, P3 = 16, P4 = 18, P5 = 1
RR: P1 = 4+2+1+1+1 = 9; P2 = 1; P3 = 2+3 = 5; P4 = 3; P5 = 4+2+1+1+1 = 9
SJF.
B) (6 points) Discuss the pros and cons of linked-allocation of file blocks and how MS-DOS implements a linked-allocation structure, the File Allocation Table (FAT).
In a linked allocation, the file is a linked list of disk blocks (which may be scattered anywhere). The directory entry points to first and last blocks
Pros: - No external fragmentation
- No need to declare size of file
Cons: - Best only for sequential access. Random access may incur multiple
seeks and traversal through the linked list.
- Overhead for pointer in each block
- Reliability: pointers may be lost or damaged
FAT: File allocation Table of MS-DOS
C) (4 points) How would one a) allocate a free block to a file in DOS, and b) access a random block efficiently in DOS using the FAT ?