cfinals

0.0(0)
studied byStudied by 5 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/38

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

39 Terms

1
New cards

multithreaded program

A ______________ contains two or more parts that can run concurrently. Multithreading allows tasks waiting for other resources to give way to other processing requests.

2
New cards

A _______ is the smallest unit of execution that the operating system can schedule.

thread

3
New cards

process

A ______ is a group of associated threads executed in the same shared environment.

4
New cards

single-threaded, multithreaded process

A ___________ process contains exactly one thread, whereas a _____________ supports more than one thread.

5
New cards

shared environment

In a ______________, threads in the same process share the same memory space and can communicate directly with one another.

6
New cards

concurrency

The property of executing multiple threads and processes simultaneously is referred to as ___________

7
New cards

thread scheduler

Operating systems use a ______________ to determine which threads should be currently executing

8
New cards

context switch

A ___________is the process of storing a thread’s current state and later restoring the state of the thread to continue execution.

9
New cards

main thread

When a Java application starts, its main() method is executed by the ________ – a special thread that is created by the Java VM to run the application.

10
New cards

• Extend the Thread class and override the run() method.

• Implement the Runnable interface.

A thread can be created in two (2) ways:

11
New cards

start()

To start the Java thread, call its _____ method.

12
New cards

run()

The ______ method is what is executed by the thread after calling start().

13
New cards

the run() method is done

The start() call will not wait until _______________

14
New cards

different CPU

The run() method will execute as if executed by a __________.

15
New cards

Start()

Starts a thread by calling its run method

16
New cards

Run()

The entry point for the thread

17
New cards

setName()

Sets a thread’s name

18
New cards

getName()

Obtains a thread’s name

19
New cards

setPriority()

Sets a thread’s priority

20
New cards

getPriority()

Obtains a thread’s priority

21
New cards

isAlive()

Determines if a thread is still running

22
New cards

Join()

Waits for a thread to terminate

23
New cards

sleep()

Suspends a thread for a period of time

24
New cards

thread priority

A _________ is a numeric value associated with a thread that is taken into consideration by the thread scheduler when determining which threads should currently be executing.

25
New cards

1

MIN_PRIORITY (value)

26
New cards

10

MAX_PRIORITY (value)

27
New cards

5

NORM_PRIORITY (value)

28
New cards

Generic types (or generics)

_________________ associate one or more non-specified Java types upon creation. These are declared within angle brackets (<>).

29
New cards

wildcard argument

The ____________ represents an unknown type and is specified by the question mark. Wildcards allow greater control of the types you use.

30
New cards

unbounded and bounded.

2 categories of wildcard arguments:

31
New cards

<?>

____ denotes an unbounded wildcard. It can be used to represent any type.

32
New cards

upper-bounded wildcard

To relax restrictions on a variable, use an _____________.

33
New cards

('?')

To declare an upper-bounded wildcard, use the wildcard character ___ , followed by the extends keyword and its upper bound.

34
New cards

sumOfList

The __________ method returns the sum of the numbers in a list.

35
New cards

lower-bounded

A _______________ wildcard restricts the unknown type to be a specific type or a super type of that type.

36
New cards

Thread

the Java ______ object representing the thread executing a given block of code can be accessed.

37
New cards

higher priority

A thread with _________ does not necessarily mean that it will run faster or more often than others; it only has greater potential access to the CPU.

38
New cards

interrupt or supersede

A thread can_____________ another thread with a higher thread priority than the other thread.

39
New cards

passing an instance of the class to a Thread object's constructor

A thread can be run by _____________________________ and then calling the thread's start() method.