Unit 9 - Concurrency and Multithreading Flashcards

1
Q

List 3 challenges of concurrent systems

A

Coordination
- Consolidating things after breaking program into processes that may be executed out of order
- Sync up between different processes

Memory Management
- How much memory does each process get

Scheduling
- Which process is active at what time

Deadlocks
- Two processes keep waiting for each other

Resource Starvation

Race Conditions

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

Threads with shared memory are sometimes interleaving on a

A

single processor core using a scheduling algorithm.

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

In Java, each thread is associated with an

A

object of type Thread or a class that extends Thread.

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

The following are some of the reasons that could make using multiple threads a better choice

A
  • It is simpler to design the program as a system of concurrent threads, because the software system has several responsibilities that require its continual and constant attention all at the same time. Eg:
    – The software system has to control multiple physical or virtual devices in a timely manner (eg embedded real-time systems, GUIs).
    – The software simulates several independent active entities (eg computer games or mechanical system simulators).
  • The task is distributed over a network by its nature (eg an Internet phone system).
  • The task is very resource-intensive and needs to make the best possible use of multiple processors or clustered computers (eg a web search engine).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A thread is launched using the

The thread object has to have a

A

start method of the associated object.

method run, which is executed by the new thread on launch and thus defines what the thread should be doing.

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

In Ada, threads are called

A

tasks

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

Shared memory is hard to manage correctly. Common problems include

A

race conditions, deadlocks and thread starvation.

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

Transactional memory is an approach to

A

managing shared data in way that facilitates safe concurrent access by multiple threads without locking.

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