Processing Techniques Grade 11

Modern computers can execute multiple tasks simultaneously using multitasking, multithreading and multiprocessing. This page also covers virtual memory, compilers and interpreters.

Processing Techniques

A processing technique is a method the operating system and CPU use to handle more than one job at a time so the computer feels fast and responsive. In the early days a computer could only do one thing from start to finish before moving on. Today we expect to type an email, listen to music and download a file all at once — and these techniques are what make that possible.

Why Do We Need This?

A CPU is incredibly fast, but a human is slow. While you pause to think about your next sentence, the CPU is sitting idle for millions of cycles. Processing techniques let the computer fill those gaps with other work, so no time is wasted and every program feels like it is running "at the same time".

THINK OF A CHEF IN A KITCHEN

Imagine one chef preparing several dishes. Multitasking is the chef stirring one pot, then quickly turning to chop onions, then back to the pot — one pair of hands switching between jobs so fast it looks simultaneous. Multithreading is one big recipe (say a curry) broken into steps that move along together — the sauce simmers while the rice cooks, all part of the same dish. Multiprocessing is hiring several chefs (CPU cores), each cooking a whole dish at the same moment in real parallel.

TechniqueDescriptionExample
MultitaskingOS rapidly switches between multiple programs, giving the illusion of simultaneous executionListening to music while browsing the web
MultithreadingA single program is divided into threads that run concurrentlyBrowser: separate threads for UI, downloads, rendering, scripts
MultiprocessingMultiple CPU cores execute tasks truly in parallelA quad-core CPU running 4 tasks simultaneously

Note: The key difference to remember is that multitasking and multithreading share one processor by taking turns, while multiprocessing uses multiple processors to do work truly at the same moment.

Virtual Memory

Virtual memory is storage space on the hard drive that the operating system uses as if it were extra RAM. When the real RAM fills up, the OS borrows a slice of the much larger (but much slower) hard drive to keep programs running instead of crashing.

Why Do We Need This?

RAM is expensive and limited. Without virtual memory, the moment your RAM filled up the computer would simply refuse to open the next program. Virtual memory acts as a safety valve so you can keep working even when memory is tight.

A DESK AND A FILING CABINET

Picture your RAM as the top of your desk — small, but everything on it is right in front of you and instantly reachable. The hard drive is a big filing cabinet across the room — it holds far more, but you must get up and fetch things from it. When your desk overflows, you move papers you are not using right now into the cabinet (virtual memory) and fetch them back when you need them. It works, but every trip to the cabinet wastes time.

When RAM is full, the OS uses a section of the hard drive as temporary RAM — called virtual memory.

Thrashing is what happens when the computer spends more time swapping data back and forth between RAM and virtual memory than it spends doing actual useful work. The hard drive light stays on constantly, the mouse stutters, and everything slows to a crawl. In our desk analogy, thrashing is when your desk is so small that you are constantly running to the filing cabinet and back, never getting anything done.

Solutions when thrashing occurs:

Compilers vs Interpreters

Computers only understand machine code (binary 1s and 0s), but humans write in readable programming languages. A translator is needed to bridge that gap. There are two main kinds, and the difference is all about when the translation happens.

TWO KINDS OF TRANSLATOR

Think of translating a book. A compiler is like a translator who sits down and translates the whole book into a finished printed copy — slow to prepare, but afterwards anyone can read it instantly. An interpreter is like a live human interpreter standing next to a speaker, translating each sentence out loud as it is spoken — you can start immediately, but it is slower overall because translation happens during the conversation.

CompilerInterpreter
How it worksTranslates entire source code to machine code at onceReads and executes one line at a time
SpeedSlower to open program, faster once runningFaster to open, slower while running
On errorStops completely — program never opensRuns until error is hit, then crashes
ExamplesDelphi, C++Python, JavaScript

Virtualisation

Virtualisation is the technique of using software to create a "virtual" computer — called a virtual machine — that runs inside your real computer as if it were a separate physical machine with its own operating system.

Why Do We Need This?

One powerful computer can be split into several virtual machines, so a single server can do the work of many. This saves money, electricity and space, and lets you safely test risky software in a sealed-off environment without endangering your real system.

A BUILDING WITH SEPARATE FLATS

Imagine one large building (your physical computer). Virtualisation divides it into several self-contained flats (virtual machines). Each flat has its own front door, kitchen and tenants (its own operating system and programs), and what happens in one flat does not affect the others — yet they all share the same building, plumbing and electricity (the real hardware).

Example: Running Windows on a Mac, or a single cloud server hosting dozens of separate websites, each in its own virtual machine.

Programming Languages

TypeDescriptionExamples
Low-levelClose to machine code; fast and efficient; hard to readAssembly language
High-levelEnglish-like; easier to write and understand; compiled or interpretedDelphi, Python, Java, C++

Types of Errors

Error TypeDescription
SyntaxCode typed incorrectly — won't compile
RuntimeCrashes while running (e.g. divide by zero)
LogicalRuns but gives wrong output
OverflowCalculation result too large for the data type