09 Concurrency Flashcards
It contains two or more parts that can run concurrently.
Multithreaded program
It allows tasks waiting for other resources to give way to other processing requests.
multithreading
It is the smallest unit of execution that can be scheduled by the operating system
thread
It is a group of associated threads executed in the same shared environment.
process
It contains exactly one thread.
single-threaded process
It supports more than one thread.
multithreaded process
It is where threads in the same process share the same memory space and can communicate directly with one another.
Shared environment
It is the property of executing multiple threads and processes simultaneously.
Concurrency
OS uses this to determine which threads should be currently executing.
Thread scheduler
It is the process of storing a thread’s current state and later restoring the state of the thread to continue execution.
context swtich
It is a special method created by the Java VM to run your application.
main thread
What are the two (2) ways you can create a thread?
Extend the Thread class and override the run() method.
Implement the Runnable interface.
It consists of several methods that allow you to manage threads.
Thread class
What are the methods of the Thread class? (9)
start()
run()
setName()
getName()
setPriority()
getPriority()
isAlive()
join()
sleep()
It 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.
thread priority