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".
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.
| Technique | Description | Example |
|---|---|---|
| Multitasking | OS rapidly switches between multiple programs, giving the illusion of simultaneous execution | Listening to music while browsing the web |
| Multithreading | A single program is divided into threads that run concurrently | Browser: separate threads for UI, downloads, rendering, scripts |
| Multiprocessing | Multiple CPU cores execute tasks truly in parallel | A quad-core CPU running 4 tasks simultaneously |
- Multitasking – running several programs at once by switching rapidly between them. Only one task truly runs at any instant, but the switching is so quick it feels simultaneous.
- Multithreading – splitting a single program into smaller "threads" that progress together, so one slow part (like a download) does not freeze the rest of the program.
- Multiprocessing – using two or more CPU cores to genuinely execute different tasks at the same time. This is real parallelism, not an illusion.
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.
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.
- Programs not currently in use are swapped from RAM to virtual memory
- When needed again, they are swapped back into RAM
- Allows more programs to run than physical RAM would normally allow
- Much slower than real RAM — heavy use causes thrashing (performance crash)
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:
- Close unnecessary background apps
- Increase physical RAM
- Upgrade to 64-bit OS
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.
- Compiler – a translator that converts the entire source code into machine code in one go, before the program ever runs, producing a standalone executable file.
- Interpreter – a translator that reads and runs the code one line at a time, translating each line just as it is about to be executed.
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.
| Compiler | Interpreter | |
|---|---|---|
| How it works | Translates entire source code to machine code at once | Reads and executes one line at a time |
| Speed | Slower to open program, faster once running | Faster to open, slower while running |
| On error | Stops completely — program never opens | Runs until error is hit, then crashes |
| Examples | Delphi, 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.
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
| Type | Description | Examples |
|---|---|---|
| Low-level | Close to machine code; fast and efficient; hard to read | Assembly language |
| High-level | English-like; easier to write and understand; compiled or interpreted | Delphi, Python, Java, C++ |
Types of Errors
| Error Type | Description |
|---|---|
| Syntax | Code typed incorrectly — won't compile |
| Runtime | Crashes while running (e.g. divide by zero) |
| Logical | Runs but gives wrong output |
| Overflow | Calculation result too large for the data type |