FIT2070 Lecture Notes - Lecture 3: Batch Processing, Program Counter, Process State
L3 - Process Description & Control
Process = program code + data + PCB
Process Elements
● Program code: can be shared with other processes that are executed the same
program
● Data associated with that code: when processor begin to execute the program, this is
referred to as a process
● While program is executing, this process can be characterised by these elements
○ Identifier
○ State
○ Priority
○ Program counter
○ Memory pointers
○ Context data
○ I/O status information
○ Accounting information
Process Control Block (PCB)
● Contains the process elements
● Important when interrupts occur
● Key tool that allows support for multiple processes
Scheduling & Execution
●Dispatcher - small program that switches from process to process
● Trace - behaviour of an individual process by listing the sequence of instructions that
execute for that process
Two-state Process Model
● Running- completes instruction execution gets interrupted and starts again
● Not Running
Reason for Process Creation
● New batch job
○ When OS is ready to take on new work it will read the next sequence of job
control commands
● Interactive Logon
○ A user at a terminal logs on to the system
● Created by OS to provide a service
○ OS create a process to perform a function on behalf of a user program,
without the user having to wait
● Spawned by existing process
○ When the OS create a process at the explicit request of another process
Process Termination
● End of completion of process
● Or halt
● Reasons
○ Normal completion
○ Time limit exceeded
○ Memory unavailable
○ Invalid instruction
Five-State Process Model
Suspend Processes
● Swapping: involves moving part or all of a process from main memory to disk
● Characteristics
○ Process is not immediately available for execution
○ Process was placed in a suspended state by an agent
○ Process may or may not be waiting on an event
○ Process may not be removed from this state unit the agent explicitly order the
removal
● Reasons:
○ Swapping - OS needs to realise MM to bring in a process that is ready to
execute
○ Timing - process may be executed periodically and may be suspended while
waiting for the next time interval
○ Deadlock
Once Suspend State
Two Suspend State
Document Summary
Process = program code + data + pcb. Program code: can be shared with other processes that are executed the same program. Data associated with that code: when processor begin to execute the program, this is referred to as a process. While program is executing, this process can be characterised by these elements. Key tool that allows support for multiple processes. Dispatcher - small program that switches from process to process. Trace - behaviour of an individual process by listing the sequence of instructions that execute for that process. Running- completes instruction execution gets interrupted and starts again. When os is ready to take on new work it will read the next sequence of job control commands. A user at a terminal logs on to the system. Created by os to provide a service. Os create a process to perform a function on behalf of a user program, without the user having to wait.