What is multithreading

CPU basics: multithreading

In general, the possible levels of parallelism in program execution are divided into four different classes:

  • Hardware parallelism (pipeline)

  • Instruction-level parallelism (superscalar, VLIW)

  • Thread level parallelism (multithreading)

  • Process parallelism (multiprocessor)

RISC and superscalar processors only implement hardware and instruction level parallelism. The "ends" of this parallelism scale are well known, hardware and process parallelism have been in use for years. Nevertheless, the approach of process parallelism, i.e. a MIMD computer according to Flynn's classification, is very dependent on the software in terms of its quality. The instruction-level parallelism is also used very intensively by superscalar and VLIW processors. Therefore, only thread level parallelism remains as a research and development topic. The first question that arises is what a thread actually is:

  • A thread is an activity carrier (sequential execution thread) with minimal context (stack and register) within an execution environment (process). In this case, each process has at least one (initial) thread. All threads belonging to one and the same process share the same address space as well as other resources of this process.

This definition is "soft" in a sense, it leaves a lot of room for interpretation. Threads can be defined by the software developer (development of multithreaded programs); smaller units, right down to the basic blocks (see superscalar processor architectures), could also be referred to as threads - but then with a different context and properties.