Skip to content
IT glossary
ProgrammingUpdated December 3, 2026

Parallelism

Параллелизм

Parallelism means doing multiple pieces of work at the same instant, such as processing two images on separate CPU cores. It can help a program finish sooner or get more work done in the same amount of time.

What makes execution parallel?

Suppose a video editor needs to render a set of independent frames. With one worker, it renders one frame after another. With several workers on different CPU cores, it can render several frames at the same instant. That simultaneous execution is what makes the work parallel.

Concurrency is about managing multiple tasks whose lifetimes overlap, not necessarily running their instructions at once. A single-threaded event loop can handle many requests concurrently by switching to another request whenever one is waiting for I/O. That does not make the application code on that thread execute in parallel. Likewise, async does not by itself move a CPU-heavy calculation to another core.

How to split the work

With data parallelism, workers apply the same operation to different pieces of the input, as in the frame example. With task parallelism, workers carry out different operations at the same time, such as rendering video frames while another worker processes the audio. Threads and processes are common ways to express the work on a CPU; GPUs can also run many operations in parallel. Launching workers makes simultaneous execution possible, but the hardware and runtime determine whether it actually happens.

Example: counting records

Imagine counting error records in a large in-memory array. Give each worker a slice of the array to read and let it build a private count. Once the workers finish, add their counts together. If they instead increment the same shared counter without synchronization, updates can be lost: two workers may read the same old value and both write back the same incremented value. Locking every increment prevents lost updates, but also forces workers to take turns on the counter. Private counts avoid that bottleneck.

When more workers stop helping

Parallel execution is common in rendering, numerical simulations, analytics, and test suites with independent tests. It is most useful when there is enough independent work to justify the cost of scheduling, communication, and combining results. The serial portion sets a hard limit: if 25% of the original runtime cannot be sped up, even eliminating the other 75% would yield only a 4× speedup. Real programs can hit other limits sooner. Workers scanning an array may saturate memory bandwidth, and uneven chunks can leave most workers idle while one finishes.

What interviewers look for

Start by stating whether the goal is to reduce the time for one job or to complete more jobs per second. Then describe which work is independent, what state is shared, and where workers have to wait for one another. To check whether the split was worthwhile, compare end-to-end performance against a sequential baseline on representative inputs and vary the worker count.