Chapter 4 Threads Flashcards

1
Q

What happens when a user level thread ULT blocks in a multithreaded process that is mapped to only one kernel level thread?

A

The process stops.

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

List one advantage of having a thread pool.

A

Faster to service a request with a existing thread.

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

What is a LWP?

A

(Light Weight Process), maps user level to kernel level thread to one or more user level thread.

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

Do threads have their own stack pointer?

A

yes

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

Why does it take less time to create a user level thread as opposed too a kernel level thread?

A

user level thread does not involve kernel, kernel level threads create overhead.

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

What are the benefits of multithreaded programming?

A

Responsiveness, Resource sharing, Economy, Utilization of MP Architectures

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

What are some examples of how threads are used?

A

File Server, Spread Sheet Program and Word Processor

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

What’s Solaris’ purpose? Describe some concepts

A

Implements the one-to-one mapping from LWP to a kernel thread and a one or more mapping between User-level thread.

Process – normal UNIX process
User-level threads – allows application parallelism
Lightweight processes
Kernel threads – entities manipulated by the scheduler

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

What are the advantages and disadvantages of user-level threads?

A

Advantages: Portable, scheduling is dependent on application needs, doesn’t require kernel mode intervention when switching threads.

Disadvantages: All threads are blocked when a system function is called

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

What’s the significance of User level threads?

A

Thread management, they…….
Create and destroy threads
Communication between threads
Scheduling and saving and restoring thread contexts

Libraries include:
Win32
POSIX Pthreads
java

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

What’s the advantage and disadvantages of kernel level threads?

A

Advantage: Supported by the Kernel

Major disadvantage – switching between threads requires a mode switch to the kernel

Examples:
Windows XP/2000
Solaris
Linux
Tru64 UNIX
Mac OS X
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Many to one

A

maps many user-level threads to one kernel thread.

Entire process blocks when a blocking system call is invoked.

Because of one kernel thread mapping, other threads can not run in parallel on a multiprocessor.

Examples:
Solaris Green Threads
GNU Portable Threads

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

One-to-One

A

maps each user thread to a kernel thread.

allows multiple threads to run in parallel on multiprocessors.

Examples:
Windows NT/XP/2000
Linux
Solaris 9 and later

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

Many-to-Many

A

Allows many user level threads to be mapped to many kernel threads.

Allows the operating system to create a sufficient number of kernel threads.

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

Data parallelism

A

Focuses on distributing subsets of the same data across multiple computing cores and performing the same operation on each core.

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

Task parallelism

A

Involves distributing not data but tasks (threads) across multiple computing cores.

17
Q

What’s the difference between a thread and process?

A

A thread is a basic unit of CPU utilization. A process is an executing program.

18
Q

How do Solaris kernel threads communicate to the application.

A

With light weight process.