Computer-science_A-level_Cie
-
computers-and-components6 主题
-
logic-gates-and-logic-circuits2 主题
-
central-processing-unit-cpu-architecture6 主题
-
assembly-language-4 主题
-
bit-manipulation1 主题
-
operating-systems3 主题
-
language-translators2 主题
-
data-security3 主题
-
data-integrity1 主题
-
ethics-and-ownership3 主题
-
database-concepts3 主题
-
database-management-systems-dbms-1 主题
-
data-definition-language-ddl-and-data-manipulation-language-dml1 主题
-
computational-thinking-skills1 主题
-
algorithms14 主题
-
data-types-and-records2 主题
-
arrays2 主题
-
files1 主题
-
introduction-to-abstract-data-types-adt1 主题
-
programming-basics1 主题
-
constructs2 主题
-
structured-programming1 主题
-
program-development-life-cycle2 主题
-
program-design-2 主题
-
program-testing-and-maintenance3 主题
-
user-defined-data-types1 主题
-
file-organisation-and-access-3 主题
-
floating-point-numbers-representation-and-manipulation3 主题
-
protocols2 主题
-
circuit-switching-packet-switching1 主题
-
processors-parallel-processing-and-virtual-machines5 主题
-
boolean-algebra-and-logic-circuits4 主题
-
purposes-of-an-operating-system-os3 主题
-
translation-software3 主题
-
encryption-encryption-protocols-and-digital-certificates3 主题
-
artificial-intelligence-ai4 主题
-
recursion1 主题
-
programming-paradigms4 主题
-
object-oriented-programming7 主题
-
file-processing-and-exception-handling2 主题
-
data-representation5 主题
-
multimedia3 主题
-
compression2 主题
-
networks-and-the-internet11 主题
process-management
Multitasking & process states
What is multitasking?
-
Multitasking is the ability of the operating system to manage system resources (such as memory and the CPU) in a way that gives the user the impression that multiple programs are running at the same time
-
In reality, the CPU can only execute one instruction at a time
-
It can process billions of instructions per second, and can switch between tasks so quickly that it gives the illusion of programs running simultaneously
-
The OS splits tasks and allocates system resources based on a priority
What is a process?
-
A process is a program in execution
-
This includes:
-
The program code
-
Current data
-
Register values
-
Memory space
-
-
Each running application is treated as a separate process by the OS
-
A process does not always run continuously
-
It changes state depending on what it’s doing and whether it has access to the CPU or is waiting for something
Process states
|
State |
Description |
|---|---|
|
Running |
The process is actively being executed by the CPU |
|
Ready |
The process is prepared to run but is waiting for the CPU to be available |
|
Blocked |
The process is waiting for an event or resource, such as I/O completion |
Scheduling routines
What is scheduling?
-
Deciding which tasks to process, for how long, and in what order is achieved through scheduling algorithms
-
A CPU is responsible for processing tasks as fast as possible
-
Different algorithms are used to prioritise and process tasks that need CPU time
-
The algorithms have different uses, benefits and drawbacks
Scheduling categories
-
Pre-emptive: allocates the CPU for time-limited slots
-
Allocates the CPU for a specific time quantum to a process
-
Allows interruption of processes currently being handled
-
It can result in low-priority processes being neglected if high-priority processes arrive frequently
-
Example algorithms include Round Robin and Shortest Remaining Time First
-
-
Non-pre-emptive: allocates the CPU to tasks for unlimited time slots
-
Once the CPU is allocated to a process, the process holds it until it completes its burst time or switches to a ‘waiting’ state
-
A process cannot be interrupted unless it completes or its burst time is reached
-
If a process with a long burst time is running, shorter processes will be neglected
-
Example algorithms include First Come First Serve and Shortest Job First
-
Scheduling algorithms
Round robin (RR)
-
RR is a pre-emptive scheduling algorithm
-
Equally distributing processor time amongst all processes
-
Each process is given a time quantum to execute
-
Processes that are ready to be worked on get queued
-
If a process hasn’t been completed by the end of its time quantum, it will be moved to the back of the queue

Round robin scheduling algorithm
First-Come-First-Served (FCFS)
-
FCFS is non-pre-emptive, prioritising processes that arrive at the queue first
-
The process currently being worked on will block all other processes until it is complete
-
All new tasks join the back of the queue

First-Come-First-Served scheduling algorithm
Multi-Level Feedback Queue (MLFQ)
-
MLFQ is a pre-emptive priority algorithm where shorter and more critical tasks are processed first
-
Multiple queues are used so that tasks of equal size are grouped together
-
All processes will join the highest priority queue but will trickle down to lower priority queues if they exceed the time quantum

Multi-Level Feedback Queue scheduling algorithm
Shortest Job First (SJF)
-
SJF is non-pre-emptive, where all processes are continuously sorted by burst time from shortest to longest
-
When new processes arrive on the queue, they are prioritised based on their burst time in the next cycle
-
Shorter jobs are placed at the front of the priority queue
-
Longer jobs have lower priority, so they are placed at the back

Shortest job first scheduling algorithm
Shortest Remaining Time First (SRTF)
-
SRTF is a pre-emptive version of SJF, where processes with the shortest remaining time are higher priority
-
Time quantum is set, and if a task doesn’t complete in time, it will be re-queued for further processing
-
Before the next cycle starts, all processes are inspected and ordered by the shortest remaining time to complete

Responses