Skip to learning content

Learning Center

2.1 Workers, threads, pace, and the nearby shelf

Lesson

Practice lab

0 / 2solved

Saved on this device. Practice is ungraded.

Build and test

Meet a build-server deadline

A software release pipeline has a 600-second slot for three compiles and a release-demo video export. Choose a CPU costing at most $240 and an export mode that finishes the batch before the slot closes. The supplied app produces the same output in either mode; measured times include software scaling, cache, and scheduling.

Three compiles + export—
CPU price—

Change choices to compare results, then check the requirements.

  • Batch at most 600 seconds
  • CPU at most $240
Calculate

Compare compiler upgrade results

A software team is comparing CPUs for its build workstation. The same compiler workload takes 120 seconds on CPU A at 4.0 GHz and 90 seconds on CPU B at 3.6 GHz. Report time reduction using (old − new) ÷ old × 100, and throughput multiplier using old ÷ new. Base the recommendation on this workload, not GHz alone.

Lesson notes

Compare cores, scheduled threads, clock speed, and cache to understand workload performance.

More cores help when threads can be shared

More cores can help with video rendering, compiling, virtual machines, and other tasks that can split work into several threads. They may not help much when an app mostly uses one main busy thread.

  • Many workers help when the job can be divided.
  • One-worker jobs need a strong individual worker.
  • Software decides how well work can be shared.

What threads mean in CPU conversations

A thread is a single line of work inside a program. The operating system schedules threads onto CPU cores, so one app may have one busy thread while another app may spread work across many threads.

CPU spec sheets may list cores and threads separately. Extra threads often come from simultaneous multithreading, sometimes called SMT or Hyper-Threading, where one physical core presents two logical scheduling slots. Those logical threads can improve utilization, but they still share the same core resources.

  • A CPU listed as 6 cores / 12 threads has six physical cores and twelve logical scheduling slots.
  • More threads help most when software is written to split the job cleanly.
  • Logical threads are useful, but they are not the same as adding full physical cores.

Cache reduces waiting

Cache helps the CPU avoid walking across the building for every tool. When data is already nearby, the CPU can keep working. When data is missing, the CPU waits.

Worked example

Inputs: Same benchmark/settings: CPU A finishes in 120 s; CPU B in 90 s. A is 4.0 GHz and B is 3.6 GHz.

Task: Calculate elapsed-time reduction and explain whether GHz alone predicts the result.

Check the reasoning

(120 − 90) / 120 = 25% less elapsed time; throughput is 120 / 90 = 1.33 times. GHz alone did not predict the result.

Time reduction and throughput gain differ. Compare the same workload and test conditions.