______ computing: several computations are performed during overlapping time periods, as opposed to sequential
concurrent
Property of a program that can do multiple things at the same time
concurrency
A _____ is a basic unit of CPU utilization within a process
thread
____-_____ process: concurrent execution of different parts of the same program
multi-threaded
Name four things that each thread has its own of:
1. thread ID
2. program counter
3. register stack
4. stack
Name two things that threads share with other threads within the same process.
1. code section
2. data section
Creating a thread is ______ _____ than creating a process under MacOSX/Linux and _____ ______ than creating a process under Windows.
- slightly cheaper
- much cheaper
Context-switching between threads is ______ _____ than between processes
slightly cheaper
True/False: If one thread fails, then the process fails (and therefore the whole program).
True
Java Green Threads is a ______-level thread library to support threads in _____ Space.
user, User
Most modern OSes support ______ threads. In fact, Linux doesn't really make a difference between processes and threads (same data structure).
kernel
Many-to-One Mode
- ____-_____ is efficient and low-overhead
- cannot take advantage of a ___-____ architecture
- if one thread _____, then all the others do
Examples:
- Java _____ Threads
- ____ Portable Threads
- multi-threading
- multi-core
- blocks
- Green
- GNU
One-to-One Model:
- Removes both drawbacks of the ____-__-____ Model
- Creating new threads requires work by the ____ (Not as fast as the ____-__-____ Model)
Example:
- _____, ______, Solaris 9 and later
- Many-to-One
- kernel, Many-to-One
- Linux, Windows
Many-to-Many Model:
- A compromise
- If a user thread blocks, the kernel can create new _____ threads to avoid blocking all users
- A new user ____ doesn't necessarily require the creation of a new ____ thread.
- True _____ can be achieved on a multi-core machine
Examples:
- Solaris 9 and earlier
- Win NT/2000 with the ThreadFiber package
- kernel
- thread, kernel
- concurrency
Two-Level Model:
- User can say...?
Example:
- IRIX, HP-UX, Tru64 UNIX
- Solaris 8 and earlier
"Bind this thread to its own kernel thread"
The Thread Library in C/C++ called Pthreads is implemented by the ______.
kernel
The Thread Library in C/C++ called OpenMP is a layer _____ Pthreads for convenient multi-threading in "easy" cases.
above
The Thread Library in Java called Java Threads is implemented by the ____, which relies on threads implemented by the ______.
JVM, kernel
In Java Threads, to launch, or ____, a thread, you just call the (encapsulating) thread's _____ method. DO NOT call the _____ method directly to launch a thread.
spawn, start(), run()
Name the possible thread state returned by getState():
- A thread that hasn't been started yet
NEW
Name the possible thread state returned by getState():
- The thread can be run, and may be running as we speak
- it might not because another ______ thread could be running
RUNNABLE
Name the possible thread state returned by getState():
- The thread is blocked on a monitor
BLOCKED
Name the possible thread state returned by getState():
- The thread is waiting for another thread to do something
WAITING
Name the possible thread state returned by getState():
- The thread is waiting for another thread to do something, but will give up after a specified time out
TIMED_WAITING
Name the possible thread state returned by getState():
- The thread's run method has returned