AP® Computer Science Principles · Big Idea 4 · Topic 4.3

Sequential, Parallel, and Distributed Computing

Sequential computing runs steps one after another; parallel computing runs pieces at the same time on multiple processors; distributed computing spreads pieces across separate machines on a network. Splitting work never gives a perfect speedup because some part of the task and some coordination cost can't be divided.

Sequential computing does one step, then the next, then the next, so a task of n equal steps takes n time units. Parallel computing breaks the task into independent pieces that run at the same moment on different processors, so n steps split evenly across p processors takes roughly n divided by p time units. The speedup only works if the pieces truly don't depend on each other's results. If step 5 needs the answer from step 4, those two steps can't run at the same time no matter how many processors you have.

Parallel computing usually means multiple cores inside one machine, sharing memory and swapping data almost instantly. Distributed computing means separate machines, each with its own memory, passing data over a network instead. Distributed systems scale to far more workers and survive a single machine failing, but network communication is slower and less reliable than one machine talking to itself, so coordinating the pieces costs more time.

This connects to the rest of the unit because the same fault-tolerant, packet-based network that lets the internet survive a cut cable is what distributed processors use to send pieces of a job back and forth. It also explains a limit the unit keeps circling back to: real speedup is bounded not by hardware alone, but by how much of a task is genuinely parallel. The sequential portion of a task, and the overhead of splitting work and collecting results, both eat into the gains four workers were supposed to deliver.

Key terms

Sequential computing
Running the steps of a task one at a time, in order, on a single processor.
Parallel computing
Splitting a task into independent pieces that run at the same time on multiple processors.
Distributed computing
Spreading pieces of a task across separate machines that communicate over a network.
Speedup
How many times faster a parallel or distributed version runs compared to the sequential version.
Overhead
The extra time spent splitting work, coordinating workers, and combining results, which isn't part of the actual task.

Watch it explained

  1. How it worksHow does a parallel solution break a task into pieces that run at the same moment?
  2. How it worksWalk me through the difference between two cores in one machine and two machines on a network.
  3. Worked exampleShow me a task of eight equal steps run sequentially and then spread across four processors.
  4. Common mistakeWhy isn't every task splittable into parallel pieces?

Check yourself

Your turn1 of 2
A task of 47 equal steps, run sequentially, takes n time units. Split evenly across 6 processors, how many time units does the parallel version take?

End of topic.