DSA Factory
Free Processes and threads lessonsProcesses and threads · Stage 1 · Threads · Step 1

Why threads exist

See how doing several things at once inside one process hides waiting time, and what it costs to set up. About 12 minutes.

Quick check

Which of these does each thread of a process have its own copy of?

  1. AIts stack and its registers
  2. BThe heap
  3. CThe global variables
Show the answer

Its stack and its registers. A separate flow of control needs its own place in the code and its own locals.

Lock it in

4 questions on this idea

Short questions that apply the idea to new cases: trace it, work out a number, put steps in order. A wrong answer explains itself.

Answer them in your browserFree account, no card. Your progress is saved, and the idea comes back in a quick review later.
Sign up free to solve