• Foundation
  • About 12 min
  • 5 practice questions

Multitasking, multiprocessing and multithreading

Tell multitasking, multiprocessing and multithreading apart, and say what a CPU core and a thread are in plain language.

If something looks wrong, please tell us.

Three long words sound alike and are often confused in exams: multitasking, multiprocessing and multithreading. Each one is about doing several things, but in a different way. This lesson separates them with simple pictures and small calculations.

Multitasking: many programs, one at a time very fast

Multitasking means keeping several programs open and running them in turns. The CPU gives each program a very short time slice, then moves on to the next. Because the turns are so fast, it feels as if everything runs together. When you listen to music, download a file and type a message at once, your computer is multitasking.

Multiprocessing: more than one CPU or core

Multiprocessing means a computer has more than one processor, or more than one core inside one processor chip, so that two or more things really do run at the same moment. A phone or laptop with four cores can run four tasks truly in parallel. Having more cores helps most when the work can be divided into parts.

Multithreading: many small paths inside one program

A thread is a small part of a program that can run on its own while sharing the same program space. A web browser might use one thread to load a page, another to play a video and a third to check spelling. Using several threads in one program is multithreading.

Three ideas compared
TermWhat is shared outKey wordEveryday picture
MultitaskingCPU time among programsTurnsOne cook cooking several dishes by switching quickly
MultiprocessingWork among several CPUs or coresParallelFour cooks in one kitchen
MultithreadingWork among threads of one programThreadsOne cook with several helpers on one recipe

Worked example 1: time slices

A computer runs 5 programs. Each gets a time slice of 20 milliseconds before the next program gets a turn. How long is one full round? 5 x 20 = 100 milliseconds. So each program gets the CPU again after every 100 milliseconds, which is one tenth of a second. That is quick enough that you do not notice the switching.

Worked example 2: dividing work among cores

A job that would take 12 seconds on one core is split into four equal parts that can all run at the same time on four cores. In the ideal case it takes 12 / 4 = 3 seconds. In real life it takes a little longer, because some parts of a job must wait for others. This example is only illustrative.

Worked example 3: which word?

An exam question says: "A computer with two processors runs two programs at exactly the same instant." The two processors running real work in parallel point to multiprocessing. If it had said "one processor switches quickly between three programs", the answer would be multitasking.

Notice that Task Manager lists dozens of processes even when you have opened only one program. The operating system and many background services are running too. A computer with a single core can still multitask, because switching is fast; extra cores simply allow more tasks to run at the same moment. A program written to use only one thread will keep just one core busy, however many cores the computer has.

Multitasking = turns on one CPU. Multiprocessing = many CPUs or cores. Multithreading = many threads in one program.

Key takeaways

  • Multitasking only looks simultaneous; multiprocessing is truly simultaneous.
  • A thread is a part of a program; a process is the whole running program.
  • More cores do not make a single, undivided task faster.

Check your understanding

  1. 1. Switching quickly among several programs on one CPU so that all seem to run together is

    1. Multiprocessing
    2. Multitasking
    3. Booting
    4. Spooling
    Show answer

    Answer: B. Giving each program a short time slice in turn is multitasking.

  2. 2. A computer with four cores can run four tasks at the same instant. This is called

    1. Multiprocessing
    2. Virtual memory
    3. Defragmentation
    4. Compression
    Show answer

    Answer: A. More than one core or CPU doing real work in parallel is multiprocessing.

  3. 3. A small part of a program that can run on its own is called a

    1. Thread
    2. Driver
    3. Folder
    4. Pixel
    Show answer

    Answer: A. A thread is a unit of work inside a process. A program with several threads is multithreaded.

  4. 4. Eight programs each get a 10 millisecond time slice in turn. How long is one full round?

    1. 18 ms
    2. 60 ms
    3. 90 ms
    4. 80 ms
    Show answer

    Answer: D. One round = 8 x 10 = 80 milliseconds.

  5. 5. A job takes 20 seconds on one core. Split equally over four cores, in the ideal case it takes

    1. 10 seconds
    2. 4 seconds
    3. 5 seconds
    4. 80 seconds
    Show answer

    Answer: C. 20 / 4 = 5 seconds in the ideal case.

Privacy · Terms · Refunds · Delivery