multithreading

multithreading

[¦məl·tə′thred·iŋ]
(computer science)
A processing technique that allows two or more of the same type of transaction to be carried out simultaneously.
McGraw-Hill Dictionary of Scientific & Technical Terms, 6E, Copyright © 2003 by The McGraw-Hill Companies, Inc.

multithreading

(parallel)
Sharing a single CPU between multiple tasks (or "threads") in a way designed to minimise the time required to switch threads. This is accomplished by sharing as much as possible of the program execution environment between the different threads so that very little state needs to be saved and restored when changing thread.

Multithreading differs from multitasking in that threads share more of their environment with each other than do tasks under multitasking. Threads may be distinguished only by the value of their program counters and stack pointers while sharing a single address space and set of global variables. There is thus very little protection of one thread from another, in contrast to multitasking.

Multithreading can thus be used for very fine-grain multitasking, at the level of a few instructions, and so can hide latency by keeping the processor busy after one thread issues a long-latency instruction on which subsequent instructions in that thread depend.

A light-weight process is somewhere between a thread and a full process.

TL0 is an example of a threaded machine language. Dataflow computation (E.g. Id and SISAL) is an extreme form of multithreading.
This article is provided by FOLDOC - Free Online Dictionary of Computing (foldoc.org)

multithreading

A feature within a CPU that allows two or more instruction streams (threads) to execute concurrently. Each stream is a "subprocess" that is managed by the CPU and operating system. Multithreading takes advantage of the superscalar architecture in most CPUs combined with the fact that while one operation takes place, very often another can proceed simultaneously. For example, as soon as an instruction to output data to storage is given, a huge number of data processing instructions (compare, copy, goto, etc.) can be executed while storage is being written. Depending on the program logic, instructions can be executed out of sequence and benefit from some overlap.

Both operating systems and applications may be written to use threads. However, designing the program logic for multithreading that ensures instructions are always executed without conflict can be a daunting task.

Multicore vs. Multithreading
Multicore CPUs have two or more processing cores, each capable of executing instructions in parallel. In fact, except for low-cost microcontrollers, most CPUs have two or more cores. In contrast, multithreading occurs within a single processing core to increase performance approximately 25%. Each thread is a "logical core" rather than a physical core. See microcontroller.

Today's CPUs generally support at least two threads per core, but some handle many more. For example, IBM's POWER10 CPU comes with up to 15 cores, and each core handles eight threads for a total of 120 threads. Tasks such as video rendering and machine vision, which perform millions of identical calculations on a matrix of pixels, are candidates for multithreading. See superscalar, SMP, re-entrant code, multicore, multiprocessing and Hyper-Threading.


No Multithreading
Each of these two cores in this dual-core CPU example is executing instructions independently of the other. The arrows point to the two machine instructions being executed at the moment.







Dual Cores and Two Threads
Each core has two threads, which provides some degree of overlap within the routines that are executing simultaneously. If both threads in both cores are executing, four operations are taking place simultaneously.







Threads Galore
The cover of Software Development Times in November 2012 highlighted the issue that CPUs with many cores provide more channels of parallel instruction execution.
Copyright © 1981-2025 by The Computer Language Company Inc. All Rights reserved. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher.
Mentioned in
Copyright © 2003-2025 Farlex, Inc Disclaimer
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.