Chapter 4 (Threads) Flashcards

1
Q

What are the two main characteristics of a process?

A

Resource ownership

Scheduling/execution

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

T/F A processes main characteristics could be split apart and managed separately

A

T

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

What do we get if we split the two main characteristics of a process?

A

Process: owns resources

Thread: Executes

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

Refers to multiple threads of execution in a single process

A

Multithreading

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

What is a process called that is not multithreaded?

A

Single-threaded

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

How many threads does MS-DOS support?

A

1

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

T/F Traditional UNIX supports multiple user processes but only supports one thread per process

A

T

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

What modern OS’s support multiple threads per process?

A

Solaris and Windows

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

What does a process have in a multithreading context?

A

Virtual address space for the process image

Resource ownership

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

What does a thread have in a multithreading context?

A

Thread execution state

Thread context

Stack

Local variables

Shared access to memory and resources of its process

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

T/F In a multithreaded process model, each thread shares the user stack and kernel stack

A

F, they each have their own

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

What are some benefits of threads?

A

Faster to create

Faster to terminate

Faster to switch between

Communication between threads is more efficient

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

T/F Threads make program organization harder

A

F, they can make it easier

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

“word processor, thread to periodically save to disk” is an example of:

A

Asynchronous processing

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

overlapping activity is an example of:

A

Speed-up execution

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

Structuring a program logically into threads may aid with program design” is an example of:

A

Modularity

17
Q

What states are associated with a thread?

A

Running

Ready

Blocked

18
Q

T/F Suspending a process involves suspending all threads of the process since all threads share the same address space

A

T

19
Q

T/F Termination of a process would terminate all threads within the process

A

T

20
Q

What is a key benefit of threads?

A

Speed-up in execution through parallelism

21
Q

T/F On a uniprocessor with multithreading, threads among the same process or differing processes are interleaved

A

T

22
Q

What are the two ways to implement thread support in an OS?

A

User-level threads

Kernel-level threads

23
Q

What are user-level threads?

A

Supports threading with the use of a thread library and the OS is not aware of the threads

24
Q

What are kernel-level threads?

A

The OS supports threads itself

25
Q

What are the advantages of user-level threads?

A

Thread switching does not involve the kernel (so it’s faster)

Scheduling can be application specific

Can run on any OS

26
Q

What are the disadvantages of user-level threads?

A

Most system calls are blocking for processes (all threads within the process will be blocked)

The kernel can only assign processes to processors (two threads within the same process cannot run simultaneously on two processors)

27
Q

What are the advantages of kernel-level threads?

A

The kernel can simultaneously schedule many threads of the same process on many processors

Blocking is done on a thread level, so one thread in a process can block while another runs

Kernel routines can be multithreaded

28
Q

What are the disadvantages of the kernel level threads?

A

Thread switching within the same process requires a mode switch to the kernel, which may result in a significant slowdown

29
Q

Amdahl’s law formula

A

1/(1-f)+(f/N)

30
Q

T/F Typically, there is the same overhead cost as the number of processors involved increases

A

F, increased overhead

31
Q

Can be made to run effectively on a multicore system

A

Database servers

32
Q

What are some other examples of software that may benefit with multiple cores?

A

Multithreaded applications

Multiprocess applications

Java applications (JVM as well)

Multi-instance applications (running more than one instance in parallel)