Chapter 13 Flashcards

1
Q

When is a concurrent program scalable?

A

when the speed of its execution increases when more processors are available.

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

What are the motivations to use on concurrent machines?

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

Who suggested a categorization of computer architectures?

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

How many types of computer architectures are there?

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

What level of program concurrency is best supported by MIMD computers?

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

What is the producer-consumer problem?

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

What is the job of a scheduler?

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

What is a thread of control in a program?

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

Why are coroutines called quasi-concurrent?

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

What is a virtually multithreaded program?

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

What are four reasons for studying language support for concurrency?

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

What is a heavyweight task? What is a lightweight task.

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

Define task, synchronization, competition, and cooperation synchronization, liveness, race condition, and dead lock.

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

What kind of tasks do not require any kind of synchronization?

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

Describe the five different states in which a task can be.

A

new, ready, running, blocked, dead

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

What is a task descriptor?

A

a data structure that stores all of the relevant information about the execution state of a task.

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

In the context of language support for concurrency, what is a guard?

A

? a linguistic device that allows the guarded code to be executed only when a specified condition is true.

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

What is the purpose of a task-ready queue?

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

Mention two programming languages that support concurrency.

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

What is a guard in a semaphore?

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

What is a binary semaphore? What is a counting semaphore?

A

Binary Semaphore: a semaphore that requires only a binary-valued counter
Counting Semaphore: has a counter, but no queue for storing thread descriptors

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

What are the primary problems with using semaphores to provide synchronization?

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

What advantages do monitors have over semaphores?

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

In what three common languages can monitors be implemented?

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

Define rendezvous, accept clause, entry clause, actor task, server task, extended accept clause, open accept clause, closed accept clause, and completed task.

A

Rendezvous: actual transmission of the message
Accept Clause: the range of statements beginning with the accept reserved word and ending with the matching end reserved word.
Entry Clause:
Actor Task: they do not wait for a rendezvous in order to do their work
Server Task: a task that can have accept clauses but not have any code outside those accept clauses, so it can only react to other tasks.
Extended Accept Clause:
Open Accept Clause:
Closed Accept Clause:
Completed Task:

26
Q

Which is more general, concurrency through monitors or concurrency through message passing?

A
27
Q

What are the two operations used in semaphores?

A
28
Q

What purpose does an extended accept clause serve?

A
29
Q

How is cooperation synchronization provided for Ada tasks?

A
30
Q

What is the advantage of protected objects in Ada 95 over tasks for providing access to shared data objects?

A
31
Q

Specifically, what Java program unit can run concurrently with the main method in an application program?

A
32
Q

Mention any two programming languages that support monitors.

A

ADA, Java, C#

33
Q

What predefined class is designed to implement monitors?

A
34
Q

What does the Java yield method do?

A

takes no parameters, is a request from the running thread to surrender the processor voluntarily. The thread is put immediately in the task-ready queue, making it ready to run. The scheduler then chooses the highest-priority thread from the task-ready queue. If there are no other ready threads with priority higher than the one that just yielded the processor, it may also be the next thread to get the processor.

35
Q

What does the Java join method do?

A

forces a method to delay its execution until the run method of another thread has completed its execution. also used when the processing of a method cannot continue until the work of the other thread is complete.

36
Q

What does the Java interrupt method do?

A

sends the thread a message that sets a bit in the thread object, which can be checked by the thread.

37
Q

What are the two Java constructs that can be declared to be synchronized?

A
38
Q

Can Java threads be actor threads, server threads, or either?

A
39
Q

What are the maximum and minimum priorities of a thread in Java?

A
40
Q

Describe the actions of the three Java methods that are used to support cooperation synchronization.

A
41
Q

What kind of Java object is a monitor?

A
42
Q

Explain why Java includes the Runnable interface.

A
43
Q

What are the two methods used with Java Semaphore objects?

A
44
Q

What is the advantage of the nonblocking synchronization in Java?

A
45
Q

What are the methods of the Java AtomicInteger class and what is the purpose of this class?

A
46
Q

How are explicit locks supported in Java?

A
47
Q

Which object is used to create a C# thread?

A
48
Q

Can C# threads be actor threads, server threads, or either?

A
49
Q

What are the two ways a C# thread can be called synchronously?

A
50
Q

How can a C# thread be called asynchronously?

A
51
Q

How is the returned value from an asynchronously called thread retrieved in C#?

A

with the EndInvoke method, which takes as its parameter the object returned by BeginInvoke.

52
Q

What is different about C#’s Sleep method, relative to Java’s Sleep?

A

does not raise any exceptions, so it need not be called in a try block.

53
Q

What exactly does C#’s Abort method do?

A

it throws THREADABORTEXCEPTION, which the thread can catch. When the thread catches this exception, it usually deallocates any resources it allocated, and then ends(by getting to the end of its code).

54
Q

What is the purpose of C#’s Interlocked class?

A

the only operations that need to be synchronized are the incrementing and decrementing of an integer. These operations are done atomically with INCREMENT and DECREMENT, both of which take a reference to an integer as the paramenter.

55
Q

What does the C#’s lock statement do?

A

marks a critical section of code in a thread

56
Q

On what language is Multi-LISP based?

A

Scheme

57
Q

What is the semantics of Multi-LISP’s pcall construct?

A

the parameters of the function can be evaluated concurrently.

58
Q

What is concurrent ML(CML)?

A

an extension to ML that includes a form of threads and a form of synchronous message to support concurrency.

59
Q

What is the type of an F# heap-allocated mutable variable?

A

ref

60
Q

Why don’t F# immutable variables require synchronized access in a multithreaded program?

A

has the concurrent generic collections of .NET available to its programs. This can save a great deal of programming effort when building multithreaded programs that need a shared data structure in the form of a queue, stack, or bag.

61
Q

What is the objective of the specification statements of HPF?

A

specifying the number of processors, the distribution of data over the memories of those processors, and the alignment of data with other data in terms of memory placement.
provide information for the compiler that it may or may not use to optimize the code it produces.

62
Q

What is the purpose of the FORALL statement of HPF and Fortran?

A

specifies a sequence of assignment statements that may be executed concurrently.