Unit 04 Flashcards

1
Q

bytecode

A

The ‘machine code’ of the Java Virtual Machine, i.e. the result of compiling a Java program.

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

bytecode verifier

A

The part of the Java Virtual Machine that checks whether the bytecode about to be executed has not been tampered with.

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

class loader

A

A part of the Java Virtual Machine that loads classes at runtime into the Java Virtual Machine’s memory. Java developers can implement their own specialised class loaders.

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

conditionally thread-safe class

A

A class that requires some external synchronisation to achieve thread safety. For example, individual accesses may not need external synchronisation, but a sequence of them might.

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

contention

A

A situation in which multiple threads are attempting to obtain the same resource.

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

countdown latch

A

A flexible thread-coordination mechanism that makes one group of threads wait for each of N other threads to reach a certain point in their execution, with N being the initial value of the latch’s counter.

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

divide-and-conquer strategy

A

A problem-solving strategy that breaks down a problem into subproblems of the same or similar type, continuing the process until the obtained subproblems are simple enough to be solved directly.

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

external synchronisation

A

Synchronisation done by the callers of methods.

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

factory method

A

A method that creates objects. Typically, a factory method is a static method that hides the concrete class of the returned object: the client knows only which interface the object implements.

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

fail-fast operation

A

An operation that fails as soon as it detects some violation to consistency invariants. For example, iterators over pre-Java 1.5 collections throw an exception as soon as they detect that another thread is modifying the collection.

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

garbage collection

A

A runtime technique to free the memory occupied by objects that are no longer used. The Java Virtual Machine specification does not impose any specific garbage collection algorithm.

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

green thread

A

A thread that is not visible to the operating system and has to be created, scheduled and terminated by the Java Virtual Machine.

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

immutable class

A

A thread-safe class whose instances never change once they have been created.

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

internal synchronisation

A

Synchronisation done by the methods themselves.

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

interpreter

A

A program that executes another program.

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

Java Virtual Machine (JVM)

A

A virtual machine defined mainly with the execution of Java programs in mind. The Java Virtual Machine is a specification, and there are many implementations of it, optimised for different platforms or Java editions.

17
Q

just-in-time (JIT) compilation

A

A technique to compile a sequence of virtual machine instructions into machine code as the sequence is being executed.

18
Q

master–slave model

A

A model of communication in which one device or process (the master) has unidirectional control over other devices or processes (the slaves). For example, in a client–server system, the client is the master and the server is the slave.

19
Q

memory barrier

A

A special instruction to make local and shared memories consistent with each other.

20
Q

memory model

A

A specification of how and when updates to shared data have to be propagated across different memories and processes.

21
Q

native thread

A

A thread visible to the operating system and scheduled by it.

22
Q

nested monitor lockout

A

A situation in which a thread T blocks or waits while holding a lock on the monitor that would enable other threads to make T progress. Thread T has therefore locked itself inside the monitor, keeping the ‘key’, i.e. the monitor’s lock.

23
Q

priority queue

A

A queue that orders elements according to their associated priority so that the next element to be removed from the queue has the highest priority.

24
Q

scalability under contention

A

The ability of an algorithm to maintain a high throughput under contention, i.e. to keep a high ratio of number of threads per time unit that access the same resource.

25
Q

thread pool

A

A set of threads, each one taking a task from a common queue, executing it and then fetching the next task. The main aim of the pool is to reuse threads for multiple tasks, in order to optimise the memory usage and the performance of the application.

26
Q

thread safety

A

The property of a class behaving under concurrent access in the same way as under sequential execution. There are various levels of thread safety, depending on how much external synchronisation is necessary to achieve it.

27
Q

thread-compatible class

A

A class that provides no internal synchronisation. As such, access to it requires external synchronisation within a concurrent application.

28
Q

thread-hostile class

A

A class that is not safe to use in concurrent programs. No amount of external synchronisation will make instances of such classes behave as if they were accessed sequentially.

29
Q

thread-safe class

A

A class that has mutable instances and where the effect of any concurrent access to an instance could also be obtained by some sequential execution. Thread-safe classes do not require any external synchronisation.

30
Q

virtual machine (VM)

A

An abstract computing device implemented in software. A virtual machine defines a certain set of instructions and how code and data are organised in the machine’s memory.

31
Q

volatile variable

A

A variable declared with the volatile modifier. For practical purposes it is as if such variables are always accessed directly in shared memory. Moreover, an access to a volatile variable creates a memory barrier.

32
Q

weakly consistent operation

A

An operation that does not guarantee consistency invariants and as such does not fail under concurrent accesses. The iterators returned by the concurrency classes introduced in Java 1.5 are weakly consistent and never throw a exception due to concurrent modification.

33
Q

wrapper method

A

A method that adds new functionality or properties to existing objects. The Collections class provides static wrapper methods to turn thread-compatible collections into conditionally thread-safe ones.