Part II: 4: Threads [B1] Flashcards

1
Q

What is a thread?

A

Represent a basic unit of CPU utilization, and threads belonging to the same process share many of the process resources including code and data.
Comprises of thread ID, a program counter, a register set, and a stack.

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

What are some benefits of threads?

A
  1. responsiveness
  2. resource sharing
  3. economy
  4. scalability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain single threaded vs multithreaded programming

A

Single threaded;
* Only one sequence of instructions the CPU executes.
* Linear, all tasks executed after one another.
* Entire program affected if one task take long to complete.
* Simpler to design and debug, but lack the ability to fully utilize multi-core processors.

Multi thread:
* Multiple threads can run concurrently
* Each thread -> independent sequence of instructions and can be executed concurrently on multiple processor cores.
* Different parts of the problem can be worked on simultaneously, improving program performance, responsiveness and resource utilization.

While single-threaded programs are often easier to develop and debug, multithreaded programs can provide improved performance by leveraging the capabilities of modern hardware

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

What are the relationship between threads and multicore arcitechture?

A

The ability to execute multiple threads simultaneously, for higher performance and responsiveness.

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

Name some multithreading models

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

Explain some issues regarding multithreaded programming.

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