Question
Definition
1.
What is resource?
Answer
Resource are device connected to a
computer, internal system component is a resource, Files, Network connections
and Memory areas.
2.
Explain concept of resource management.
Answer
a.
Modern computers consist of processors,
memories, timers, disks, mice, network interfaces, printers, and a wide variety
of other devices. In the alternative view, the job of the operating system is
to provide for an orderly and controlled allocation of the processors,
memories, and input/output devices among the various programs competing for
them.
b.
When a computer (or network) has multiple users,
the need for managing and protecting the memory, input/output devices, and
other resources is even greater, since the users might otherwise interface with
one another. In addition, users often need to share not only hardware, but
information (files, databases, etc.) as well.
Function of Resource Management
3. Give
function of resource management.
Answer
a.
To
keep track of which programs are using which resources, to grant resource
requests
b.
To
account for usage
c.
To
mediate conflicting requests from different programs and users.
Types of Scheduling
4.
Explain three types of scheduling.
Answer
a. Long Term Scheduling
•
Which
determines which programs are admitted to the system for execution and when, and
which ones should be exited
b. Medium Term Scheduling
•
Which
determines when processes are to be suspended and resumed
c. Short Term Scheduling
•
Which
determines which of the ready processes can have resources, and for how long.
1.
With aid diagram describe classification of
scheduling activity.
Answer
a.
Long term: which process to admit?
b.
Medium term: which process to swap in or out?
c.
Short term: which process to execute next?
Process Control Block (PCB)
2.
Explain the Process Control Block (PCB)?
Answer
Control Block is a data structure maintained by the
Operating System for every process. A PCB keeps all the information needed to
keep track of a process.
3.
How PCB operates?
Answer
a.
Process identification.
b.
Process status (HOLD, READY, RUNNING, WAITING).
c.
Process state (process status word, register
contents, main memory info, resources, process priority).
d.
Accounting (CPU time, total amount of time, I/O
operations, number input records read, etc.).
4.
With aid diagram describe proses status.
Answer
As a process
executes, it changes state:
a.
New: the process is being created
b.
Running: instructions are being executed
c.
Blocked: the process are waiting for some event
to occur
d.
Ready: the process is waiting to be assigned to
a process
e.
Terminated: the process has finished execution
Interrupts
5.
Explain the interrupts.
Answer
a.
Interrupt is a signal to the
processor emitted by hardware or software indicating an event that needs
immediate attention.
b.
The processor responds by suspending its current
activities, saving its state, and executing a small program called an
interrupt handler (or interrupt service routine, ISR) to deal with the
event.
c.
This interruption is temporary, and after the
interrupt handler finishes, the processor resumes execution of the previous
thread.
6.
Give three types of interrupts.
Answer
a.
Hardware Interrupts (eg. Power failure – UPS
needs to take immediate action)
b.
Program Interrupts (eg. A division by zero error
in a program)
c.
Timer Interrupts (eg. An event generated by the
internal clock of the computer)
d.
Input/Output Interrupts (eg. Autosave on a Word
Document)
Non Pre-emptive Vs Pre-emptive
7.
Compare the term of non pre-emptive and pre-emptive
Answer
Non Pre-Emptive
|
Pre-Emptive
|
These
schemes do not allow process execution to be interrupted.
|
These schemes allow
interruptions.
|
Scheduling Algorithm
8.
Explain the six types of scheduling algorithm.
Answer
First Come First Served
a.
Also named as Fist In First Out (FIFO)
b.
Jobs are scheduled in order of arrival.
c.
Average waiting time can be large if small jobs
wait behind long ones.
d.
The simplest non pre-emptive scheme.
e.
Executes without interruption.
Round Robin Scheduling
a. Similar to FIFO because it runs each
process in the order in which arrives but the key difference is that it is
preemptive.
b. It does not need to know the
remaining computation time when it chooses which process will go next.
c. It allows each process in the ready
state to get access to the CPU on the regular basis.
Shortest Job First (SJF)
a. The non-pre-emptive scheme.
b. It only work if the amount of
processing time is known in advance.
Shortest Remaining Time
a.
The non pre emptive scheme.
b.
It only work if the amount of processing time is
known in advance.
Priority
a.
The priority scheduling allocation scheme
assigns a priority level to each process in the ready queue depending on its
importance.
b.
The most important are execution first, without
interruption.
Multilevel Queue
Complex systems have requirements for real time,
interactive users and batch jobs, therefore a combined scheduling mechanism
should be used
a.
The processes are divided in classes
b.
Each class has a process queue, and it has
assigned a specific scheduling algorithm
c.
Each process queue is treated according to a
queue scheduling algorithm:
d.
Each queue has assigned a priority
e.
As long as there are processes in a higher
priority queue, those will be serviced
Scheduler
1.
How Queuing Routine and Scheduler work together?
Answer
Queuing routine and a scheduler are two module that make
decision which program is loaded into memory next when a program finishes
processing and space becomes available.
Example process:
a. As programs enter the system, they
are placed on a queue by the queuing routine
b. When space becomes available, the
scheduler selects a program from the queue and loads it into memory.
c. Clearly distinguish between a
program’s internal and external priorities.
d. Once a program is in memory, the
dispatcher uses its internal priority to determine its right to access
the processor.
e. In contrast, the program’s external
priority has to do with loading it into memory in the first place.
f. Until the program is in memory, it
has no internal priority. Once in memory, its external priority is no longer
relevant
Deadlock
2.
Define the deadlock.
Answer
A set of processes is in a deadlock
state if every process in the set is waiting for an event (release) that can be
caused by process in the same time.
3.
Describe four conditions deadlock to occur.
Answer
a.
Mutual exclusion
Only one process at a time can use the resource.
b.
Hold and Wait
Processes hold resources already allocated to them while waiting for
other resources.
c.
No Pre-emptive
Resources are released by processes holding them only after that
process has completed its task.
d.
Circular Wait
A circular chain of processes exists in which each
process waits for one or more resources held by the next process in the chain.
Dispatcher
4.
With
aid diagram explain the dispatcher.
Answer
The dispatcher monitors processes and decides when to
switch execution from one process to another.
Comments
Post a Comment