1/38
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
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.
A _______ is the smallest unit of execution that the operating system can schedule.
thread
process
A ______ is a group of associated threads executed in the same shared environment.
single-threaded, multithreaded process
A ___________ process contains exactly one thread, whereas a _____________ supports more than one thread.
shared environment
In a ______________, threads in the same process share the same memory space and can communicate directly with one another.
concurrency
The property of executing multiple threads and processes simultaneously is referred to as ___________
thread scheduler
Operating systems use a ______________ to determine which threads should be currently executing
context switch
A ___________is the process of storing a thread’s current state and later restoring the state of the thread to continue execution.
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.
• Extend the Thread class and override the run() method.
• Implement the Runnable interface.
A thread can be created in two (2) ways:
start()
To start the Java thread, call its _____ method.
run()
The ______ method is what is executed by the thread after calling start().
the run() method is done
The start() call will not wait until _______________
different CPU
The run() method will execute as if executed by a __________.
Start()
Starts a thread by calling its run method
Run()
The entry point for the thread
setName()
Sets a thread’s name
getName()
Obtains a thread’s name
setPriority()
Sets a thread’s priority
getPriority()
Obtains a thread’s priority
isAlive()
Determines if a thread is still running
Join()
Waits for a thread to terminate
sleep()
Suspends a thread for a period of time
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.
1
MIN_PRIORITY (value)
10
MAX_PRIORITY (value)
5
NORM_PRIORITY (value)
Generic types (or generics)
_________________ associate one or more non-specified Java types upon creation. These are declared within angle brackets (<>).
wildcard argument
The ____________ represents an unknown type and is specified by the question mark. Wildcards allow greater control of the types you use.
unbounded and bounded.
2 categories of wildcard arguments:
<?>
____ denotes an unbounded wildcard. It can be used to represent any type.
upper-bounded wildcard
To relax restrictions on a variable, use an _____________.
('?')
To declare an upper-bounded wildcard, use the wildcard character ___ , followed by the extends keyword and its upper bound.
sumOfList
The __________ method returns the sum of the numbers in a list.
lower-bounded
A _______________ wildcard restricts the unknown type to be a specific type or a super type of that type.
Thread
the Java ______ object representing the thread executing a given block of code can be accessed.
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.
interrupt or supersede
A thread can_____________ another thread with a higher thread priority than the other thread.
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.