Professional Documents
Culture Documents
1. User submit job by placing the deck into a card reader -> submit
state
2. Job consist of many deck of programs proceeded by job control cards.
3. Job control cards pass information to OS about what resources will be
needed.
4. SPOOLing routine reads the job places it into disk -> Hold state
5. The SPOOLing routine call information management to find storage
space
6. Job scheduling routine scans all SPOOLed files and picks a job to be
admitted
7. In doing this , it will call- memory management for sufficient memory,
device management for requested devices
8. Then job scheduler call traffic controller to create associated process
information and memory management to allocate main storage.
9. The job is then loaded into memory and process ready to run. ->
ready state
10. When a processor is free- process scheduler scans list of ready to
run process and choose, assign processor-> running state
Require thousands of
Instructions to
Interact with system
Resources memory
and I/O
Similar to subroutine call but transfer the control to the operating system
rather to the users subroutine
Statement 2 and 3 are legal but do not correspond to the instruction of the
bare machine
Certain modules could be separated out and run on the extended machine is
same way as user processes
No rule for number of layers and which modules goes into which layers
Hierarchical operating system structure
All processes uses kernel and share all the system resources
Given level is allowed to call upon services of lower level but not higher levels
Example :
if a interprocess message management call service of memory
management ,
the memory module must be in lower level,
but should not call upon process message management
In the lower level- function used by all resource manager keeping track of
resource allocation
If already on then make a note that the requesting process has been placed
in WAIT state for resources
If V operator issued by another process releases the resources, then turn the
semaphore OFF and awake the process waiting for that resources
Examples of function in various levels
P, V synchronization primitive
process scheduling
Allocate memory
Release memory
Stop process
Start process
Schedule I/O
Initiate I/O
Open/close file
Determining allocation policy for memory- decide how much, when, where
the memory shoul d be allocated- if shared then determine which process
gets the memory
Analysis of technique
No special hardware
No multi programming
Example : if 256K bytes- allocated but 32K only used by a process then
remining are unused
It cannot be returned
No special hardware
If access made then an iterrupt must occur and control is transfered to the OS
In supervisor mode can access the protected, and execute the privileged
instructions
Job scheduler can be viewed as macro scheduler- choosing which job will run
User sub divide the job into job steps- processed sub tasks
One to one correspondence- one job create one process and assigned a
processor in non multiprogramming
For multiprogramming systems- job scheduler creates processes for the jobs
and assign the processor
Submit state
Hold state
Ready state
Running state
Completed
3
4
5
1.1job scheduler
Keep track of status of all jobs. It must note which jobs are trying to get some
service (hold state) and status of all jobs being serviced (ready, running, or
blocked)
Choose the policy to enter the system based on priority, resources requested
Allocate the necessary resources for the scheduled job by use of memory ,
device and processor management
Deallocate the resources when the job is done
Process scheduling
Once job moved form hold to ready it creates one or more processes
Functions
1. Keep track of the status of the process traffic controller (running, ready,
blocked)
2. Deciding which process gets a processor for how long processor scheduler
3. Allocation of processor to process traffic controller
4. Deallocation of processor- when running process exceeds the current
quantum or must wait for an I/O completion traffic controller
Job and process synchronization
Mechanism to prevent race condition
Example: request a printer while it is printing
P and V operator
Semaphore
Deadlock a situation- two processes , each waiting for resources that the
other has and will not give up
Structure of processor management
Mechanism
for keeping
track of jobs
is to have
separate
JCB (Job
Control
Block) for
each job
JCB created
when a
process is in
hold state.
Contains
entries
regarding
its status,
position in
the job
queue.
Priority and
Policies
Job scheduler must choose from the HOLD state and put it into READY to RUN
Choosing may be arbitrarily or shortest job
Key concept
Policy issue
Typical consideration
Policies- Key concept
More job wish to run
Most resources are finite
Many resources cannot be shared or easily reassigned to another process
Policies- policy issue
Running as many jobs as possible- only short jobs
Keeping the processor busy
Fairness to all jobs
Policies- typical consideration
To determine a job scheduling policy
Availability of special resources
With preference
Without preference
Cost-higher rates for faster service
System commitments- processor time and memory-the more you want the
longer you wait
System balancing- mixing I/O intensive and CPU intensive
Guaranteed service
Completing the job by or at specific time
job scheduler has selected a collection of jobs to run
the process scheduler schedules dynamically
Job and process scheduler may interact.
Process scheduler postpone a process and sends it back to the macro-level
job scheduling
Once a processor has been assigned a processor it does not release the
processor until it is finished
One CPU process is created for each job
Policy to reduce average turnaround time
Job scheduling using FIFO
estimated
got from job
control
cards
Other
Assume job
information
arrive
set by
Sample
operatingjob
arrival time
system
Turnaround
time amount
of time to
execute a
particular
process/job
Needs
tape
Process identification
Current state
Priority
Copy of active registers
Pointers to list of other processes in same
state
Etc.