ArticleslgStudy

computer science

Multiprocessing

Multiprocessing is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Multiprocessing rather than just read about it. In short: Multiprocessing (MP) is the use of two or more central processing units (CPUs) within one computer system. The term also refers to the ability of a system to support more than one processor or the ability to allocate tasks between them.

Key takeaways

  • Multiprocessing belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Multiprocessing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Multiprocessing from memory before moving on to harder problems.

Reference excerpt

Multiprocessing (MP) is the use of two or more central processing units (CPUs) within one computer system. The term also refers to the ability of a system to support more than one processor or the ability to allocate tasks between them. Many variants of this basic theme exist, and the definition of multiprocessing can vary with context, mostly as a function of how a processor is defined (multi-core processors (multiple cores) on one die, multiple dies in one chip carrier (package), multiple packages in one computer case (system unit), etc.). A multiprocessor is a computer system having two or more CPUs (processors: multiple processors) each sharing main memory and peripherals, to simultaneously process programs. A 2009 textbook defined multiprocessor system similarly, but noted that the processors may share "some or all of the system's memory and I/O facilities"; it also gave tightly coupled system as a synonymous term. At the operating system level, multiprocessing is sometimes used to refer to the execution of multiple concurrent processes in a system, with each process running on a separate CPU or core, in contrast to one process at any one instant. When used with this definition, multiprocessing is sometimes contrasted with multitasking, which may use only one processor but switch it in time slices between tasks (i.e., a time-sharing system). In contrast, multiprocessing means true parallel execution of multiple processes using more than one processor. Multiprocessing doesn't necessarily mean that one process or task uses more than one processor simultaneously; the term parallel processing is generally used to denote that practice. Other authors prefer to refer to the operating system techniques as multiprogramming and reserve the term multiprocessing for the hardware aspect of having more than one processor. The remainder of this article discusses multiprocessing only in this hardware sense. In Flynn's taxonomy, multiprocessors as defined above are Multiple instruction, multiple data (MIMD) machines. As the term "multiprocessor" normally refers to tightly coupled systems in which all processors share memory, multiprocessors are not the entire class of MIMD machines, which also contains message passing multicomputer systems.

Key topics

Processor symmetry In a multiprocessing system, all CPUs may be equal, or some may be reserved for special purposes. A combination of hardware and operating system software design considerations determine the symmetry (or lack thereof) in a given system. For example, hardware or software considerations may require that only one particular CPU respond to all hardware interrupts, whereas all other work in the system may be distributed equally among CPUs; or execution of kernel-mode code may be restricted to only one assigned CPU, whereas user-mode code may be executed in any combination of processors. Multiprocessing systems are often easier to design if such restrictions are imposed, but they tend to be less efficient than systems in which all CPUs are used. Systems that treat all CPUs equally are called symmetric multiprocessing (SMP) systems. In systems where all CPUs are not equal, system resources may be divided in a number of ways, including asymmetric multiprocessing (ASMP), non-uniform memory access (NUMA) multiprocessing, and clustered multiprocessing.

Master/slave multiprocessor system In a master/slave multiprocessor system, the master CPU is in control of the computer and the slave CPU(s) performs assigned tasks. The CPUs can be very different in speed and architecture. Some (or all) of the CPUs can share a common bus, each can also have a private bus (for private resources), or they may be isolated except for a common communications pathway. Likewise, the CPUs can share common RAM and/or have private RAM that the other processor(s) cannot access. The roles of master and slave can change from one CPU to another. Two early examples of a mainframe computer master/slave multiprocessor are the Bull Gamma 60 and the Burroughs B5000. An early example of a master/slave multiprocessor system of microprocessors is the Tandy/Radio Shack TRS-80 Model 16 desktop computer, released in February 1982. It ran the multi-user/multi-tasking Xenix operating system, Microsoft's version of Unix (named TRS-XENIX). The Model 16 has two microprocessors: an 8-bit Zilog Z80 CPU running at 4 MHz, and a 16-bit Motorola 68000 CPU running at 6 MHz. When the system is booted, the Z-80 is the master and the Xenix boot process initializes the slave 68000, and then transfers control to the 68000, whereupon the CPUs change roles and the Z-80 becomes a slave processor responsible for all input/output (I/O) operations including disk, communication, printer, and network, keyboard, and integrated monitor, while the operating system and applications run on the 68000 CPU. The Z-80 can be used to do other tasks. The earlier TRS-80 Model II, released in 1979, is also a multiprocessor system as it has both a Z-80 CPU and an Intel 8021 microcontroller in the keyboard. The 8021 made the Model II the first desktop computer system with a separate detachable lightweight keyboard connected with by one thin flexible wire, and likely the first keyboard to use a dedicated microcontroller, both attributes copied years later by Apple and IBM.

Instruction and data streams In multiprocessing, the processors can be used to execute a single sequence of instructions in multiple contexts (single instruction, multiple data (SIMD), often used in vector processing), multiple sequences of instructions in a single context (multiple instruction, single data or MISD, used for redundancy in fail-safe systems and sometimes applied to describe pipelined processors or hyper-threading), or multiple sequences of instructions in multiple contexts (multiple instruction, multiple data or MIMD).

Processor coupling

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Multiprocessing

Start with the simplest possible case. Write down what Multiprocessing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Multiprocessing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Multiprocessing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Multiprocessing

In research
Multiprocessing appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Multiprocessing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Multiprocessing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Classes of computers, Computing terminology, Parallel computing, so understanding it makes those chapters shorter.
In everyday life
Look for Multiprocessing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Multiprocessing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Multiprocessing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Multiprocessing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Multiprocessing in simple terms?

Multiprocessing (MP) is the use of two or more central processing units (CPUs) within one computer system. The term also refers to the ability of a system to support more than one processor or the ability to allocate tasks between them.

Why does Multiprocessing matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Multiprocessing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Multiprocessing.

Tags

  • Classes of computers
  • Computing terminology
  • Parallel computing

Keep exploring