Role of the OS:
Supported in the these ways:
Shell (or Command-Line-Interpreter)
® Process creation and management ® I/O handling ® Secondary storage management ® Main memory management ® File system access ® Protection
Control Statements of the Shell
User-driven commands to the OS (vs. event-driven commands such as interrupts)
Process
-program in execution
How Is a Process an Abstraction of the CPU?
- Every process acts as though it has exclusive access to the CPU
In Reality: Multiprogramming
Threads
Difference between threads and processes
What makes up a process?
Program vs Process
Process is a dynamic entity
-a program becomes a process when it is loaded into memory
Process Control Block (PCB)
Processes Represented In Memory with Current “State”
Context Switch
Process Scheduling: Multiprogramming Goal
- have some process running (using the CPU) all time
Process Scheduling: Time –sharing Goal
- switch CPU among processes frequently enough
Process Scheduler
it selects the
process for program execution on the CPU
Job Queue
Contains all processes in system
Ready Queue
It includes processes that are residing in main memory and are ready to execute
Device Queues (Waiting) Queue Headers
It includes processes waiting for an I/O device
Schedulers
-Select which processes to allocate to CPU
-Submitted processes can be spooled into disk for
later execution
Short term scheduler
Long term scheduler
-moves processes from disk to main memory
CPU Bound
spends more time doing computations
I/O Bound
spends more time doing I/O
I/O heavy mix
the ready queue will always be empty (no process is ready to use the CPU as they are in the device queue )