Podcast
Questions and Answers
Which of the following BEST describes a 'program' in the context of processor management?
Which of the following BEST describes a 'program' in the context of processor management?
- An inactive unit, such as a file stored on disk. (correct)
- A portion of a process that runs independently.
- An active entity requiring resources to perform a function.
- A unit of work submitted by a user that is currently being executed.
In a multiprogramming environment, what is the primary role of the operating system regarding CPU allocation?
In a multiprogramming environment, what is the primary role of the operating system regarding CPU allocation?
- To prioritize I/O operations over CPU-bound tasks.
- To ensure fair and efficient CPU allocation for each competing job. (correct)
- To dedicate the CPU to a single process to maximize its performance.
- To prevent multiple processes from running simultaneously.
What is the purpose of a 'context switch' in processor management?
What is the purpose of a 'context switch' in processor management?
- To allocate CPU resources to the job with the shortest execution time.
- To activate a higher-priority program in response to an interrupt.
- To save the processing information of a job when it is interrupted. (correct)
- To balance I/O interaction and computation.
How do multi-CPU systems utilize the concepts of processor management as presented for single-CPU systems?
How do multi-CPU systems utilize the concepts of processor management as presented for single-CPU systems?
What are the two sub-managers that comprise the Processor Manager?
What are the two sub-managers that comprise the Processor Manager?
Which of the following is a primary responsibility of the Job Scheduler?
Which of the following is a primary responsibility of the Job Scheduler?
What is the main goal of job scheduling?
What is the main goal of job scheduling?
Which of the following BEST describes the role of the Process Scheduler?
Which of the following BEST describes the role of the Process Scheduler?
What is a key characteristic of an I/O-bound job?
What is a key characteristic of an I/O-bound job?
What is the primary objective of CPU or Processor scheduling?
What is the primary objective of CPU or Processor scheduling?
Which statement accurately describes the 'ready' and 'running' process states?
Which statement accurately describes the 'ready' and 'running' process states?
What is the purpose of a Process Control Block (PCB)?
What is the purpose of a Process Control Block (PCB)?
Which of the following is NOT typically stored in a Process Control Block (PCB)?
Which of the following is NOT typically stored in a Process Control Block (PCB)?
How are queues utilized in the context of Job PCBs?
How are queues utilized in the context of Job PCBs?
In what way do queues use control blocks to track jobs?
In what way do queues use control blocks to track jobs?
Why is a context switch necessary when moving a process to the running state?
Why is a context switch necessary when moving a process to the running state?
Which of the following is NOT a typical limitation that operating systems must resolve when pre-scheduling tasks?
Which of the following is NOT a typical limitation that operating systems must resolve when pre-scheduling tasks?
What does 'throughput' measure in process scheduling?
What does 'throughput' measure in process scheduling?
What is the primary goal of minimizing response time in process scheduling?
What is the primary goal of minimizing response time in process scheduling?
What is a potential problem if a job claims the CPU for a very long time before issuing an I/O request?
What is a potential problem if a job claims the CPU for a very long time before issuing an I/O request?
How does the Process Scheduler typically handle a situation where a job has claimed the CPU for too long?
How does the Process Scheduler typically handle a situation where a job has claimed the CPU for too long?
What is the KEY difference between preemptive and non-preemptive scheduling policies?
What is the KEY difference between preemptive and non-preemptive scheduling policies?
Which of the following process scheduling algorithms is non-preemptive?
Which of the following process scheduling algorithms is non-preemptive?
Which scheduling algorithm is known for its simplicity and uses a FIFO queue?
Which scheduling algorithm is known for its simplicity and uses a FIFO queue?
In which type of system is First-Come, First-Served (FCFS) scheduling most suitable?
In which type of system is First-Come, First-Served (FCFS) scheduling most suitable?
What is a significant disadvantage of the First-Come, First-Served (FCFS) scheduling algorithm?
What is a significant disadvantage of the First-Come, First-Served (FCFS) scheduling algorithm?
What makes the Shortest Job Next (SJN) algorithm optimal?
What makes the Shortest Job Next (SJN) algorithm optimal?
Why is the Shortest Job Next (SJN) algorithm generally unsuitable for interactive systems?
Why is the Shortest Job Next (SJN) algorithm generally unsuitable for interactive systems?
How does priority scheduling handle jobs with equal priority?
How does priority scheduling handle jobs with equal priority?
Which of the following is a method used by the Processor Manager to assign priorities?
Which of the following is a method used by the Processor Manager to assign priorities?
How does 'aging' affect priority assignment in process scheduling?
How does 'aging' affect priority assignment in process scheduling?
How does Shortest Remaining Time (SRT) differ from Shortest Job Next (SJN)?
How does Shortest Remaining Time (SRT) differ from Shortest Job Next (SJN)?
Which characteristic makes Shortest Remaining Time (SRT) difficult to implement in interactive systems?
Which characteristic makes Shortest Remaining Time (SRT) difficult to implement in interactive systems?
What is the purpose of the 'time slice' or 'quantum' in the Round Robin scheduling algorithm?
What is the purpose of the 'time slice' or 'quantum' in the Round Robin scheduling algorithm?
What happens if the time quantum in Round Robin is set too large?
What happens if the time quantum in Round Robin is set too large?
What factor should be considered when determining the best quantum time size?
What factor should be considered when determining the best quantum time size?
What is the purpose of Multiple-Level Queues in process scheduling?
What is the purpose of Multiple-Level Queues in process scheduling?
Which of the following is NOT a typical method for moving jobs between queues in a Multiple-Level Queue system?
Which of the following is NOT a typical method for moving jobs between queues in a Multiple-Level Queue system?
For what type of systems is the Earliest Deadline First (EDF) algorithm primarily designed?
For what type of systems is the Earliest Deadline First (EDF) algorithm primarily designed?
What is a potential problem with the Earliest Deadline First (EDF) algorithm?
What is a potential problem with the Earliest Deadline First (EDF) algorithm?
Which of the following is an example of an internal interrupt?
Which of the following is an example of an internal interrupt?
What is the role of the interrupt handler?
What is the role of the interrupt handler?
Flashcards
Program (job)
Program (job)
An inactive unit of code that is stored on disk.
Process (task)
Process (task)
A program in execution; an active entity requiring resources.
Process management
Process management
Tracking processes and their states.
Thread
Thread
Signup and view all the flashcards
Processor (CPU)
Processor (CPU)
Signup and view all the flashcards
Multiprogramming environment
Multiprogramming environment
Signup and view all the flashcards
Multitasking
Multitasking
Signup and view all the flashcards
Interrupt
Interrupt
Signup and view all the flashcards
Context Switch
Context Switch
Signup and view all the flashcards
Processor Manager
Processor Manager
Signup and view all the flashcards
Job Scheduler
Job Scheduler
Signup and view all the flashcards
Process Scheduler
Process Scheduler
Signup and view all the flashcards
Job Scheduler functions
Job Scheduler functions
Signup and view all the flashcards
Process Scheduler functions
Process Scheduler functions
Signup and view all the flashcards
I/O-bound job
I/O-bound job
Signup and view all the flashcards
CPU-bound job
CPU-bound job
Signup and view all the flashcards
CPU / Processor Scheduling
CPU / Processor Scheduling
Signup and view all the flashcards
Process Control Block (PCB)
Process Control Block (PCB)
Signup and view all the flashcards
Process ID
Process ID
Signup and view all the flashcards
Processor status information
Processor status information
Signup and view all the flashcards
Processor state information
Processor state information
Signup and view all the flashcards
Accounting
Accounting
Signup and view all the flashcards
Computer program traits
Computer program traits
Signup and view all the flashcards
Process States
Process States
Signup and view all the flashcards
CPU Context Switch
CPU Context Switch
Signup and view all the flashcards
CPU utilization
CPU utilization
Signup and view all the flashcards
Turnaround Time
Turnaround Time
Signup and view all the flashcards
Throughput
Throughput
Signup and view all the flashcards
Waiting time
Waiting time
Signup and view all the flashcards
Response time
Response time
Signup and view all the flashcards
Maximize throughput
Maximize throughput
Signup and view all the flashcards
Minimize response time
Minimize response time
Signup and view all the flashcards
Minimize turnaround time
Minimize turnaround time
Signup and view all the flashcards
Minimize waiting time
Minimize waiting time
Signup and view all the flashcards
Non-preemptive scheduling
Non-preemptive scheduling
Signup and view all the flashcards
Preemptive scheduling
Preemptive scheduling
Signup and view all the flashcards
Process Scheduling Algorithms
Process Scheduling Algorithms
Signup and view all the flashcards
First Come First Served (FCFS)
First Come First Served (FCFS)
Signup and view all the flashcards
Shortest Job Next (SJN)
Shortest Job Next (SJN)
Signup and view all the flashcards
Priority Scheduling
Priority Scheduling
Signup and view all the flashcards
Study Notes
- These notes cover processor management, focusing on single-CPU systems
- Multi-CPU and multi-core systems are not explored
Core Concepts
- Program (Job):
- Inactive unit, such as a file stored on a disk
- Represents a unit of work submitted by a user
- Process (Task):
- A program in execution
- Can be described as an Active entity
- Requires resources like a processor and registers
- Thread:
- A portion of a process that runs independently
- Processor (CPU):
- Performs calculations and executes programs
Key Terms
- Multiprogramming: Involves multiple processes competing to run on a single CPU, requiring fair and efficient CPU allocation
- Multitasking: Describes one user running multiple programs, which requires sharing of resources
- Interrupt:
- A call for help that activates a higher-priority program
- Context Switch:
- Saving job processing information when interrupted
Scheduling Sub-Managers
- Processor Manager: Composed of two sub-managers:
- Job Scheduler (higher-level) handles job scheduling responsibilities and job initiation
- Process Scheduler (lower-level) handles process scheduling responsibilities, determines execution steps
Job Scheduling
- Functions:
- Selects incoming jobs from a queue
- Places jobs in a process queue
- Decides on job initiation criteria
- Goal:
- Sequence jobs and balance I/O interaction and computation
- Maximize system resource utilization and keep system components busy
Process Scheduling
- Functions:
- Determines which job gets CPU resources (and for how long)
- Decides how to handle interrupt processing
- Determines queues for process movement during execution
- Recognizes process conclusion or termination
Process Types
- I/O-Bound Job:
- Performs many I/O operations, characterized by brief CPU cycles followed by long I/O cycles; for example of printing documents
- CPU-Bound Job:
- Performs lots of computation, characterized by long CPU cycles and shorter I/O cycles; for example math calculation
Process States
- Key states include Ready, Running, Waiting, New, and Terminated
- CPU/Processor Scheduling involves determining which process in the ready state should be moved to the running state
- Multiple processes can be in the ready state, but only one can be in the running state at a time
Process Control Block (PCB)
- The operating system manages data for each active process
- Data is stored in RAM in a data structure called a process control block (PCB)
- The OS maintains one PCB for each process
- Attributes Include:
- A unique Process ID
- Processor status (HOLD, READY, RUNNING, WAITING)
- Processor state information (Process Status Word, register contents, memory info, priority, resources)
- Accounting information for billing and performance measurement
- Job PCB is created and updated as the job executes
- Queues use PCBs to track jobs and that PCBs are linked to form queues
Context Switching
- The CPU has one set of registers containing values for the currently executing process
- When a process moves to the running state:
- Register values of the current running process are stored into its PCB
- Register values of the new running state are loaded into the CPU, which is a context switch
Process Scheduling Policies
- Multiprogramming: More jobs than resources at any given time results in OS pre-scheduling to resolve system limitations:
- A finite number of resources (disk drives, printers, memory, etc)
- The inability to share some resources (printers)
- The requirement for operator intervention to reassign some resources (tape drives)
Key Definitions
- CPU Utilization: Keeping the CPU as busy as possible
- Turnaround Time: the amount of time when process arrives in the ready state for the first time until it exits the running state for the last time
- Throughput: The number of processes that complete per unit of time
- Waiting Time: The amount of time a process waits in the ready queue
- Response Time: The time from request submission to the first response (in time-sharing environments)
Scheduling Policy Criteria
- Maximize throughput, minimize response time and turnaround time
- Minimize waiting time, maximize CPU efficiency, ensure fairness for all jobs
- Decisions are made by the system designer or administrator
- A corrective measure for jobs claiming the CPU for too long without an I/O request is an interrupt
Scheduling Policies
- Non-Preemptive Scheduling: The current process voluntarily gives up the CPU; the process keeps the CPU until exiting or switching to a waiting state
- Preemptive Scheduling: The OS favors another process and preempts the current one, transferring CPU to another job
Scheduling Algorithms
- Six types:
- First-Come, First-Served (FCFS)
- Shortest Job Next (SJN)
- Priority scheduling
- Shortest Remaining Time (SRT)
- Round robin
- Multiple-level queues
- Earliest deadline first (EDF)
- Interactive systems emphasize use and response time so they use preemptive policies
First-Come, First-Served (FCFS)
- Non-preemptive, handles jobs based on arrival time using a FIFO queue
- Good for batch systems, unacceptable in interactive systems because turnaround time varies
- Average turnaround time is seldom minimized
Shortest Job Next (SJN
- Non-preemptive, and job is handled based on CPU cycle time
- Easy implementation in a batch environment but known CPU time is required in advance
- Does not work in interactive system but the algorithm is optimal when all jobs are available at the same time and CPU estimates are available and accurate
Priority Scheduling
- Non-preemptive, gives preferential treatment to important jobs; programs with highest priority are processed first
- There are no interrupts until CPU cycles complete or a natural wait occurs
- READY queues may contain two or more jobs with equal priority but FCFS policy within the priority is used
- Systems admins use different methods of assigning priorities such as memory requirements, number and type of peripheral devices, CPU time
Shortest Remaining Time (SRT)
- Preemptive version of SJN
- Processor allocates to job closest to completion, preempting if a newer job has shorter completion time
- It gives to short jobs in batch environments
- It is not applicable in interactive system that requires advance CPU time knowledge and involves more overhead than SJN
Round Robin
- Preemptive
- Distributes time equitably using a time slice (quantum)
- Quantum size is crucial for performance and varies from 100 ms to 1-2 seconds and shares CPU equally among all active process
- Extensively used in interactive system
Round Robin Efficiency
- Relies on time quantum size
- Quantum too large: It suffers response time and reduces FCFS scheme algorithm
- Quantum is too small: Throughput suffers and context switching occurs
- Job execution slows down, causing overhead to dramatically increase, information saved in PCB
- Best quantum time size depends on the system
- Interactive System: Response time is key factor
- Batch: Turnaround time is key factor
- General rule of thumb: long enough for 80% of CPU cycles to complete and at least 100 times longer than context switch time requirement
Multiple-Level Queues
- Algorithms categorize processes and can be used with other policies by memory size, process type, etc
- It divides a ready queue into several queues where processes are assigned
- Each queue uses a particular scheduling algorithm
- example, interactive processes use Round Robin; background processes use FCFS and SRT
- Scheduling policy: Has a predetermined scheme
Multiple-Level Queues Characteristics
- Isn't a separate scheduling algorithm because it uses others
- Jobs are grouped according to common characteristics such as being Priority-based with CPU-bound jobs and I/O bound jobs or a hybrid environment
- Queues use a predetermined schedule according to policy
Earliest Deadline First (EDF)
- A dynamic priority, preemptive algorithm
- Addresses critical processing requirements of real-time systems which also adjusts job priorities
- Primary goal: Process jobs in order to run to completion before reaching deadlines
- Job priority is inversely proportional to its absolute deadline
- Jobs with same deadlines requires the OS using another scheme
- Priority can change as more important jobs enter the system
Problems with EDF
- Missed deadlines: This can happen if the required time for all jobs is greater than the time allocated until the total deadline as well as the OS being unable to predict throughput
- Result in high overhead from evaluation of deadlines
Interrupts
- Page Interrupt (memory manager): Accommodate job requests
- Time Quantum Expiration Interrupt
- I/O Interrupt: Result from READ or WRITE command issuance
- Internal Interrupt: Synchronous, result from arithmetic operation or job instruction
- Illegal Arithmetic Operation Interrupt: Dividing by zero; bad floating-point operation
- Illegal Job Instruction Interrupt: Protected storage/non-existent access attempt, undefined operation code
- An interrupt handler is a control program that handles the interruption event sequence and describes the type of interrupt and saves its state
- The interrupt is processed and the processor resumes normal operation
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.