Multiple CPU cores work independently because each core can execute its own instruction stream, while they work in parallel when different cores execute separate threads at the same time. However, software must be divided into suitable tasks before multiple cores can improve performance.
How Multi-Core Processing Works
Each core acts as an individual processing unit. It normally has its own control unit, arithmetic logic unit (ALU), registers, and parts of the cache, allowing it to perform the fetch-decode-execute cycle independently of other cores.
The operating system scheduler assigns processes or threads to available cores. For example, one core could run a web browser thread while another runs an antivirus process. A program designed for parallel processing can also divide one large problem into smaller subtasks and distribute them among several cores.
| Concept | How it works |
|---|---|
| Independent operation | Each core fetches, decodes, and executes its own instructions. |
| Parallel operation | Two or more cores execute different threads during the same period. |
| Shared resources | Cores may share main memory, some cache levels, and communication pathways. |
| Coordination | Threads use synchronization to control access to shared data. |
Although the cores can operate independently, they are not completely isolated. They may need to exchange data through shared memory. Synchronization mechanisms, such as locks, prevent two cores from changing the same data simultaneously and producing a race condition.
A common misconception is that doubling the number of cores always doubles performance. The speed increase depends on how much of the program can be parallelized. Sequential instructions must still run in order, while communication, synchronization, memory contention, and scheduling create additional overhead.
IB Exam Technique
For an IB Computer Science response, distinguish independent execution from parallel execution. Explain the role of threads and the operating system scheduler, then state that performance is limited by sequential code and shared-resource overhead. Do not claim that every program automatically uses all available cores.