Chapter 13 Flashcards

1
Q

Does every thread has its program counter

A

Yes

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

What are user level threads

A

They are created on user space by some library calls typically. Kernel do not know about these threads. A system call block the whole process

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

Are solaris 2, mach C-threads, POSIX Pthreads are user level threads

A

Yes

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

What are kernel level threads

A

Thread management done by kernel. Kernel aware of threads. A system call does not block the whole process.

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

Does Windows NT/2000, Solaris 2 and linux are kernel level thread examples

A

Yes

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

How many models are for thread implementation

A

Many-to-one model: A user level may have multiple thread but for kernel end, there will be only one thread to support it.
One-to-one model: One user thread per kernel thread
Many-to-many model: Multiple user threads multiplexed over a smaller or equal number of kernel threads

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

In which thread model we have true concurrency

A

one-to-one model

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

What is LWP

A

Light-weight process

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

What is PThread

A

A POSIX standard API for thread creation, termination and synchronization.

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

What are type of errors in threads

A
  • System imposed limit to total number of threads in a process.
  • Argument value is invalid
  • There is not enough memory for making threads.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is EAGAIN error

A

System imposed limit to total number of threads in a process.

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

What are 3 reasons for a thread to terminate

A
  1. Main thread who create a child thread is terminated then child will also terminate
  2. A thread uses return call
  3. A thread uses PThread exit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to include PThread library in code

A
  • Include POSIX library in code file

- use gcc command with -lpthread option

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