Ch 4 Flashcards

1
Q

Data parallelism

A

distributes subsets of the same data across multiple cores, same operation on each

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

Task parallelism

A

distributing threads across cores, each thread performing unique operation

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

User Threads

A

management done by user-level threads library i.e. POSIX Pthreads, Windows threads, Java threads

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

Kernel Threads

A

virtually all general purpose operating systems, including Windows, Solaris, Linux/UNIX, Mac OS X

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

Kernel Threads

A

virtually all general purpose operating systems, including Windows, Solaris, Linux/UNIX, Mac OS X

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

Multithreading models

A

Many-to-One - Multiple threads may not run in parallel on muticore system because only one may be in kernel at a time

One-to-One - More concurrency than many-to-one. Number of threads per process sometimes restricted due to overhead

Many-to-Many - 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
7
Q

Signals

A

Signals are used in UNIX systems to notify a process that a particular event has occurred.

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

target thread

A

If thread has cancellation disabled, cancellation remains pending until thread enables it Asynchronous cancellation terminates the target thread immediately Deferred cancellation allows the target thread to periodically check if it should be cancelled

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

TLS

A

Thread-local storage (TLS) allows each thread to have its own copy of data

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

What data gets duplicated in threads?

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

Benefits of multithreading?

A
  • Responsiveness - useful for user interfaces
  • Resource sharing - it allows an application to have several different threads of activity within the same address space.
  • Economy - because they share recources
  • Scalibility - multiprocessor architecture,
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Amdahl’s Law

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

Challenges of multithreading?

A

Identifying tasks

balance

data splitting

Data dependency

Testing and Debugging

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

thread pools

A

The general idea behind a thread pool is to create a number of threads at process startup and place them into a pool, to limit the amount of threads that can be in use (a multithread problem).

Servicing a request with an existing thread is faster.

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

block

A

A block is simply a self-contained unit of work recognized by a compiler. ( i.e printf() )

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

Signal handler

A

processes signals generated by a particular event, delivered to a process, handled

17
Q

thread cancellation

A

Asynchronous cancellation terminates the target thread immediately

asynchronous cancellation is problematic, because a thread may be terminated without letting the OS reclaim all of its recources

Deferred cancellation allows the target thread to periodically check if it should be canceled

deferred cancelation fixes the issue mentioned above.