Multi-threading / Hyper-threading Flashcards

(14 cards)

1
Q

What is multithreading?

A

A CPU feature that allows a single process to execute multiple threads concurrently

It divides a process into multiple sub-processes (threads) that can be executed simultaneously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

List key characteristics of multithreading.

A
  • Enables different parts of a single program to run concurrently
  • Requires operating system support to manage thread execution
  • Common in modern applications that benefit from parallel processing

Allows different parts of a single program to run concurrently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the benefits of multithreading?

A
  • Improves responsiveness of applications
  • Increases CPU utilization and throughput
  • Enhances performance for applications that can be divided into parallel tasks
  • Better handling of multiple operations within the same program

Particularly effective for tasks that can be executed independently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are common use cases for multithreading?

A
  • File I/O operations
  • Web browsing
  • Networking
  • Image processing

Tasks that can be easily divided into multiple independent threads without data dependencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is hyperthreading?

A

A technology that enables quicker processing by allowing a new set of instructions to start executing before the previous set has finished

It is Intel’s proprietary implementation of simultaneous multithreading (SMT).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

List key characteristics of hyperthreading.

A
  • Divides a single physical processor core into two logical/virtual cores
  • Makes a single physical core appear as two cores to the operating system
  • Enables a single processor core to run two execution threads at the same time
  • First introduced by Intel in 2002 on Xeon and Pentium 4 processors

Enhances the efficiency of CPU resource utilization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the benefits of hyperthreading?

A
  • Improves performance when running multiple applications or a single application with multiple threads
  • Better utilization of CPU resources
  • Increased throughput for certain workloads
  • More efficient use of idle CPU resources

Particularly beneficial for multitasking scenarios.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does hyperthreading work?

A
  • Each physical CPU core presents itself as two logical processors to the operating system
  • Multiple threads are scheduled on a single physical core
  • CPU can switch between threads when one is stalled
  • Takes advantage of unused execution resources within each core

This increases processor utilization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the key differences between multithreading and hyperthreading?

A
  • Multithreading: Software-level technique
  • Hyperthreading: Hardware-level technology
  • Multithreading runs multiple threads within one process
  • Hyperthreading makes one physical core appear as two logical cores
  • Managed by the operating system vs. implemented at the CPU architecture level

Multithreading works across any CPU type, while hyperthreading is Intel-specific.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can you verify if hyperthreading is enabled?

A
  • Use CPU-Z to check processor specifications
  • If cores and threads are equal, HT is disabled
  • Check BIOS/UEFI settings for HT or SMT options

When enabled, the number of threads will be twice the number of physical cores.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is hyperthreading enabled?

A
  • Usually done through BIOS/UEFI settings
  • May require system restart
  • Should be enabled for most general-purpose computing

This can enhance performance for systems running multiple applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a real-world application of hyperthreading?

A

A quad-core processor with hyperthreading enabled would show 8 logical processors

This allows the system to handle up to 8 threads simultaneously, with performance benefits most noticeable in multitasking scenarios.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Hyperthreading Characteristics?

A

Hardware-level: a feature of the CPU itself.
Appears as multiple cores.
Dual-thread processing: It allows a single core to execute two threads concurrently.
Benefits: Can improve performance in applications that benefit from parallel processing and multi-tasking.
Example: A processor might appear as having 4 logical cores, even if it has only 2 physical cores.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Multithreading Characteristics?

A

Software-level.
A program is divided into smaller, independent units of code called threads.
Threads can run concurrently (partially) or in parallel (if enough CPU cores are available).
Benefits:
Can improve performance by utilizing idle CPU resources and enabling concurrent tasks.
Example:
A web server that handles multiple user requests processes each request concurrently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly