Week 5 MultiThreading Flashcards

1
Q

What is a thread?

A

The smallest unit of execution within a process.

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

What are the advantages of using threads? List at least three.

A
  • Easy to create and handle
  • Achieve concurrency in parallel programming
  • Reduce context switching time in an operating system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the difference between kernel-level threads and user-level threads?

A

Kernel-level threads are managed by the operating system, while user-level threads are managed by the user through thread libraries.

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

Fill in the blank: User-level threads are created with ______ instead of system calls.

A

[thread libraries]

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

What are some examples of user-level threads?

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

What is a disadvantage of user-level threads?

A

Multiprocessing is very difficult because it is independent of the kernel.

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

What examples illustrate kernel-level threads?

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

True or False: Kernel-level threads are easier to create and manage compared to user-level threads.

A

False

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

What is the definition of a process?

A

Any program or software that is executing.

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

What is the creation time comparison between threads and processes?

A

Threads usually take very little time to create, while processes require more time.

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

What is the memory sharing behavior between threads and processes?

A

Threads share memory with other threads, while all processes are isolated.

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

Fill in the blank: Multithreading is a program’s ability to execute multiple threads ______.

A

[simultaneously]

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

What is the difference between concurrency and parallelism?

A

Concurrency involves tasks that execute simultaneously but not at the same time, while parallelism involves tasks that execute simultaneously and at the same time.

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

What is concurrency?

A

A mechanism that decreases the response time of the system by using a single processing unit.

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

What is parallelism?

A

A mechanism that increases computational speed by using multiple processors.

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

What is the role of the CPU in relation to threads?

A

The CPU is a hardware component that executes and reads program instructions.

17
Q

What is the relationship between threads and processing units?

A

Threads require multiple processing units, while the CPU requires a single processing unit.

18
Q

True or False: Threads improve the throughput and computation speed.

19
Q

What is the task of threads?

A

To achieve concurrency.

20
Q

What are some benefits of multithreading? List at least two.

A
  • Efficient resource sharing
  • Application scalability