A single cashier at a supermarket serves one customer at a time, and the queue grows. When the shop opens four counters, four customers are served at the same time. Parallel processing in a computer works on the same principle: several operations are carried out together instead of one after another.

What Is Parallel Processing?

Parallel processing is a method of performing many data-processing tasks at the same time to increase the speed of computation. A system can achieve this by using several functional units, such as separate adders, multipliers and logic units, so that different operations run together. The aim is to raise the amount of work done in a given time, which is called throughput, without making each single operation faster.

Definition: Parallel processing. The simultaneous execution of two or more operations, or of several parts of a task, in order to increase the speed or the throughput of a computer system.

Flynn's Classification

M. J. Flynn classified computers by the number of instruction streams and data streams that they handle at the same time. An instruction stream is the sequence of instructions executed, and a data stream is the sequence of data on which they work.

Table 4.1: Flynn's classes of computers

Class Instruction streams Data streams Example
SISD One One Simple single-processor computer
SIMD One Many Array and vector processors
MISD Many One Rarely built
MIMD Many Many Multiprocessors and clusters

Ways of Achieving Parallelism

Parallelism can be gained in several ways. Pipelining overlaps the steps of successive operations. Multiple functional units perform different operations together. Vector processing applies one operation to a whole array of data. Multiprocessing uses several processors, each running its own instruction stream. The multiprocessors may share a common memory or have their own memories and communicate by messages.

Example 4.1: Throughput with duplicated units

Problem: One adder takes 10 ns for an addition. How long do 1000 independent additions take with one adder and with four adders working in parallel?

Solution:

  1. One adder: 1000 × 10 ns = 10,000 ns.
  2. Four adders share the work, 250 additions each: 250 × 10 ns = 2,500 ns.
  3. The ratio is 10,000 / 2,500 = 4.

Result: Four adders finish in 2,500 ns, four times faster, since the additions are independent.

n, t = 1000, 10
for units in (1, 2, 4):
    print(units, "adders:", (n // units) * t, "ns")

Output

1 adders: 10000 ns
2 adders: 5000 ns
4 adders: 2500 ns

Common mistakes

  • Believing that parallel processing makes one operation faster. It increases the number of operations done at once.
  • Assuming that any program speeds up in proportion to the number of units. Dependent operations cannot run together.
  • Confusing SIMD, which has one instruction stream, with MIMD, which has many.

Key takeaways

  • Parallel processing performs several operations at the same time.
  • Flynn's classes are SISD, SIMD, MISD and MIMD.
  • Throughput is the amount of work done in a given time.
  • Independent operations are needed for a good speed-up.

Practice questions

  1. What does SIMD stand for?
  2. Define throughput.
  3. Name two methods of achieving parallelism.

Answers to the practice questions

  1. Single Instruction stream, Multiple Data streams.
  2. The amount of work a system completes in a given time.
  3. Pipelining and multiple functional units (or vector processing, multiprocessing).

Sources

  • Official BCA syllabus Computer Architecture, course code 25BCA401DS02, Unit IV