Quiz 2 Flashcards

1
Q

What tasks can be implemented using threads?

A

Updating the display, fetching data, spell checking, answering a network request.

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

What is duplicated when a new thread is created?

A

Registers, stack and PC

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

What is shared among different threads?

A

Code, Data, files

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

What are some of the benefits of thread creation?

A

Responsiveness
Resource Sharing
Economy
Scalability

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

What are some challenges with multicore programming?

A

Dividing activities, Balance, Data Splitting, Data Dependency, Testing and debugging

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

What does parallelism imply?

A

That a system can perform more than one task simultaneously.

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

What does concurrency support?

A

More than one task making progress.

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

What are the two types of parallelism?

A

Data parallelism and Task parallelism

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

What is data parallelism?

A

When subsets of the same data is distributed among multiple cores.

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

What is task parallelism?

A

When multiple threads are disputed across cores.

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

What is Amdahl’s Law?

A

The fact that performance gains from adding additional cores to an application approaches 1 / S where S is the portion that can be serial

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

What are User threads?

A

Management done by user-level threads.

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

What are the three primary thread libraries?

A

POSIX Pthreads, Windows Threads, Java threads

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

What are Kernel threads?

A

Threads created and supported by the kernel

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

What are the three Multithreading Models?

A

Many-to-One
One-to-One
Many-to-Many

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

What is Many-to-One?

A

When many user level threads are mapped to single kernel threads.

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

What are some issues with Many-to-One?

A

If one thread blocks all threads are blocked.
Multiple Threads may not run in parallel on multicore systems as only one may be in the kernel at a time.

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

What is One-to-One?

A

When each user-level thread maps to the kernel thread.

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

What is the Many-To-Many model?

A

When many user level threads can be mapped to many kernel threads.

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

What is the Two-level Model?

A

Similar to the Many to Many model except that a user thread can be bounded to a kernel thread.

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

What is a thread library?

A

A thread library provides a programmer with an API for creating and managing threads.

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

What are the 4 methods explored in reference to Implicit Threading?

A

Thread Pools
Fork-Join
OpenMP
Grand Central Dispatch

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

What are Thread Pools?

A

Thread Pools are when the system creates a number of threads in a pool where they wait to work on processes.

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

What are some advantages of Thread Pools?

A

They are usually faster
The number of threads can be bounded by the number of threads in the thread pool
Separating the task to be performed from mechanics of creating the thread allows different strategies for running tasks

25
Q

What is Fork-Join Parallelism?

A

When multiple threads are forked and then joined.

26
Q

What does OpenMP do?

A

Identify parallel regions in blocks of code that can run in parallel.

27
Q

What is Grand Central Dispatch?

A

A method for Implicit Threading that allows identification of parallel sections through syntax.

28
Q

What are some issues that can arise from threading?

A

The semantics of fork() and exec() system calls.
Signal handling
Thread cancellation
Thread-local storage

29
Q

What question can arise with the usage of fork() in a threaded process?

A

Does fork() duplicate only the calling thread or all threads?

30
Q

What questions arise when using signals in multithreaded processes?

A

Where should the signal be delivered for multi-threading?

31
Q

What are the two methods of thread cancellation?

A

Asynchronous cancellation
Deferred cancellation

32
Q

What is Thread-Local Storage?

A

When each thread has its own copy of data.

33
Q

What do Window Threads contain?

A

A thread ID
Register Set representing state of processor
Separate user and kernel stacks
Private data storage area that is used by run-time libraries and dynamic link libraries

34
Q

What is a CPU burst?

A

Process of execution consisting of a cycle of a CPU execution and I/O wait

35
Q

What are CPU bursts followed by?

A

I/O Bursts

36
Q

What is the relationship between burst duration and their frequency?

A

The higher number of bursts the shorter they are.

37
Q

What is the job of the CPU scheduler?

A

It selects from among the processes in the ready queue and allocates a CPU core to one of them.

38
Q

When will CPU scheduling decisions take place?

A

When the CPU
Switches from running to waiting
Switches from running to ready
Switches from waiting to ready
Terminates

39
Q

When does the CPU scheduler choose to schedule a new process?

A

When a process switches from running to ready or from waiting to ready.

40
Q

When is a scheduling is nonpreemptive?

A

When it doesnt choose to schedule a new process.

41
Q

What can preemptive scheduling result in?

A

Race conditions once data is shared among several processes.

42
Q

What does the dispatcher do?

A

It gives control of the CPU to the process selected by the CPU scheduler.

43
Q

What is dispatch latency?

A

The time it takes for the dispatcher to stop one process and start another.

44
Q

What are the criteria for scheduling?

A

Max CPU utilization
Max Throughput
Min Turnaround Time
Min Waiting Time
Min Response Time

45
Q

What is first come first served scheduling?

A

The first process to come is the first process to be allowed to run.

46
Q

What is the convoy effect?

A

When you place short processes behind long processes.

47
Q

What is the shortest job first sheduling?

A

A type of scheduling where the shortest process in the wait queue is done first, then the next shortest and so on.

48
Q

How is the length of the next cpu burst is calculated?

A

Through exponential averaging Tn+1 = aTn + (1-a)tn

49
Q

What is the Round Robin scheduling process?

A

Each process gets a certain amount of time to run

50
Q

What is Priority Scheduling?

A

A type of scheduling where a number is associated with each process and the process with the highest priority is done first.

51
Q

What is a multilevel queue?

A

Its similar to priority scheduling but there is a separate queue for each priority

52
Q

Which architectures can multiple processor scheduling be ran on?

A

Multicore CPU’s
Multithreaded cores
NUMA systems
Heterogenous multiprocessing

53
Q

What is symmetric multiprocessing?

A

Where each processor is self scheduling.

54
Q

What is the purpose of multicore processors?

A

To use the gap in time created by memory stalling to make progress on another thread while memory retrieve occurs.

55
Q

What is chip-multithreading?

A

When each core is assigned multiple hardware threads.

56
Q

What is load balancing?

A

Keeping each workload evenly distributed.

57
Q

What is push migration?

A

Periodic task checks loaded on each processors that pushes tasks from overloaded CPUs to other CPUs

58
Q

What is Pull Migration?

A

Having Idle processes pull waiting tasks from busy processors to other processors.