Sunteți pe pagina 1din 2

1.How does multiprogramming increase CPU utilization?

Multiprogramming increases CPU utilization by organizing jobs (code and data)


so that the CPU always has one to execute. The idea is as follows: The operating
system keeps several jobs in memory simultaneously (Fig1).
Since, in general, main memory is too small to accommodate all jobs, the jobs
are kept initially on the disk in the job pool. This pool consists of all processes
residing on disk awaiting allocation of main memory.
The goal is to reduce CPU idle time by allowing new jobs to take over the CPU
whenever the currently running job needed to wait (e.g. for user I/O).

2.What are the two basic goal that must be considered when designing an operating
system?
Operating system manages main memory, processor, device and file system
manipulation. It also responsible for protection and security of the system,
control over system performance, job accounting, error detection aids, and
coordination between other software and users. Operating system also supports
multiple execution mode.
The two basic goals of Operating System:
(i) Efficient use of a Computer System
(ii) User convenience
An Operating System can not provide both because user convenience often
conflicts with efficient use of a computer system. Efficient use is important when
a computer is shared by several users while user convenience is important in
personal computers.
User convenience has higher priority than efficient use of a Computer System
in Windows Operating System while efficient use of a Computer System has higher
priority than user convenience in Unix Operating System.

3.In what circumstances are Overlays useful?When may a section of memory be


overlayed?How does a overlaying effect program development time?
Overlay:
“The process of transferring a block of program code or other data into
internal memory, replacing what is already stored”.
Circumstances when it is useful:
In Fixed partitioning ,the size of a process has to be limited by the maximum
size of the partition, which means a process can never be span over
another.Sometimes it happens that compare to the size of the biggest partition, the
size of the program will be even more, then, in that case, we should go with
overlays ie overlays are useful.
Section of memory overlayed:
When memory space is efficiently used by allowing for repeated use of the
same areas of internal storage during the different stages of a program; for
instance, when a subroutine is no longer required, another routine can replace all
or part of it.****

4.Dekker’s Algorithm,test And Set,Swap and the Semaphore P and V may all be used to
enforce mutual exclusion.Compare and contrast their respective advantages and
disadvantages.
*********

5.. Consider the 3 processes, P1, P2 and P3 shown in the table.


Process Arrival time Time Units Required
P1 0 5 1 0
P2 1 7 3 1
P3 3 4 0
Write the completion order of the 3 processes under the policies FCFS and RR2
(round robin scheduling with CPU quantum of 2 time units) .
FCFS
As it works according to first come first serve basis,the completion order of
the 3 processes will be same as arrival ie:P1,P2,P3
Round Robin (with quantum of 2 unit times)
process | P1 | P2 | P3 | P1 | P2 | P3 | P1 | P2 | P2 |
| | | | | | | | | |
time 0 2 4 6 8 10 12 13 15 16
Thus, completion order is: P3,P1,P2

6. Consider the following table of arrival time and burst time for three processes
P0, P1 and P2.
Process Arrival time Burst Time
P0 0 ms 9 ms
P1 1 ms 4 ms
P2 2 ms 9 ms
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is
carried out only at arrival or completion of processes. What is the average waiting
time for the three processes?

S-ar putea să vă placă și