Speaking the Language:

  • Multiprocessor Systems
  • Multicore Systems
  • Hyperthreading
  • Concurrency vs Parallelism
  • Multiprogramming
  • Multiprocessing
  • Multithreading
  • Multitasking
  • Preemptive vs Non-Preemptive Multitasking
  • Context Switching
  • Process, Threads and Tasks

Multiprocessor Systems, Multicore Systems and Hyperthreading

A CPU, or Central Processing Unit does all the computations in the compute. CPU is what is typically referred to as a processor. A processor contains many discrete parts within it, such as one or more memory caches for instructions and data, instruction decoders, and various types of execution units for performing arithmetic or logical operations.

A CPU ( = processor) can contain one or multiple cores, and CPU is mounted on a motherboard. Also, a core is the basic computation unit of the CPU - it can run a single program context.

Multiprocessor Systems

In the early days, there used to beonly one physical CPU unit inserted into a single CPU socket on the motherboard. However, this meant that the CPU performed only one task at a time. So,people added additional processing power to computers by adding additional CPUs.A multiprocessor system contains more than one such CPU, allowing them to work in parallel. This is called SMP, or Simultaneous Multiprocessing.

Single core in individual processor indicates that each processor has only 1 computing element.

SMP requires a motherboard with more than one CPU socket. Multiple CPUs are inserted into different sockets. The motherboard also needs additional hardware to connect those CPU sockets to the RAM and other resources. There’s a lot of overhead here — there’s additional latency if the CPUs need to communicate with each other. Systems with multiple CPU will consume more power, will generate more heat and the motherboard needs additional sockets and hardware like heat sink etc. As a result, SMP computers are not common among home users. They can be found in among supercomputers, servers, and similar high-end systems that need as much number-crunching power as they can get.

Multicore Systems

Originally, CPUs had a single core. i.e. single computing element. That meant the physical CPU had a single execution unit on it. To increase performance, manufacturers add additional “cores,” or execution units. A dual-core CPU has two execution units or 2 cores, so it appears to the operating system as two CPUs. A process can be using each core at the same time. This speeds up your system, because your computer can do multiple things at once.

A multi-core processor implements multiprocessing in a single physical package.

Thus, a multicore CPU has multiple execution cores on one CPU. Now, this can mean different things depending on the exact architecture, but it basically means that a certain subset of the CPUs components is duplicated, so that multiple "cores" can work in parallel on separate operations. This is also called CMP, Chip-level Multiprocessing.

For example, a multicore processor may have a separate L1 cache and execution unit for each core, while it has a shared L2 cache for the entire processor. That means that while the processor has one big pool of slower cache, it has separate fast memory and arithmetic/logic units for each of several cores. This would allow each core to perform operations at the same time as the others.

Hyperthreading

A single physical CPU core with hyper-threading appears as two logical CPUs to an operating system.This is also called as SMT orSimultaneous Multithreading.

The CPU is still a single CPU, so it’s “cheating” a bit — while the operating system sees two CPUs for each core, the actual CPU hardware only has a single set of execution resources for each core. The CPU pretends it has more cores than it does, and it uses its own logic to speed up program execution. Hyper-threading allows the two logical CPU cores to share physical execution resources. This can speed things up somewhat — if one virtual CPU is stalled and waiting, the other virtual CPU can borrow its execution resources. Hyper-threading can help speed your system up, but it’s nowhere near as good as having additional cores.

Thankfully, hyper-threading is now a “bonus.” While the original consumer processors with hyper-threading only had a single core that masqueraded as 2 cores, modern Intel CPUs now have both multiple cores and hyper-threading technology. Your dual-core CPU with hyper-threading appears as four cores to your operating system, while your quad-core CPU with hyper-threading appears as eight cores. Hyper-threading is no substitute for additional cores, but a dual-core CPU with hyper-threading should perform better than a dual-core CPU without hyper-threading.

Thus, you could have a multiprocessor, multicore, multithreaded system.

Something like two quad-core, hyper-threaded processors would give you 2x4x2 =16 logical processors or 16 threads, from the point of view of the operating system.

Concurrency vs Parallelism

Concurrency is when two tasks can start, run, and complete in overlapping time periods. It doesn't necessarily mean they'll ever both be running at the same instant. e.g. multitasking on a single-core machine.

Parallelism is when tasks literally run at the same time (not in pseudo-parallelism like in single-core processors), E.g. on a multicore processor.

The term Parallelism refers to techniques to make programs faster by performing several computations in parallel. This requires hardware with multiple processing units.

The term Concurrency refers to techniques that make program more usable. Concurrency can be implemented and is used a lot on single processing units, nonetheless it may benefit from multiple processing units with respect to speed. If an operating system is called a multi-tasking operating system, this is a synonym for supporting concurrency. If you can load multiple documents simultaneously in the tabs of your browser and you can still open menus and perform more actions, this is concurrency. If you run distributed-net computations in the background, that is concurrency.

Concurrency and parallelism are NOT the same thing. Two tasks T1 and T2 are concurrent if the order in which the two tasks are executed in time is not predetermined,

  • T1 may be executed and finished before T2,

  • T2 may be executed and finished before T1,

  • T1 and T2 may be executed simultaneously at the same instance of time (parallelism),

  • T1 and T2 may be executed alternatively,

If two concurrent threads are scheduled by the OS to run on one single-core non-SMT non-CMP processor, you may get concurrency but not parallelism. Parallelism is possible on multi-core, multi-processor or distributed systems.

Concurrency is often referred to as a property of a program, and is a concept more general than parallelism.

results matching ""

    No results matching ""