Operating Systems - Threads

  1. ______ computing: several computations are performed during overlapping time periods, as opposed to sequential
    concurrent
  2. Property of a program that can do multiple things at the same time
    concurrency
  3. A _____ is a basic unit of CPU utilization within a process
    thread
  4. ____-_____ process: concurrent execution of different parts of the same program
    multi-threaded
  5. Name four things that each thread has its own of:
    • 1. thread ID
    • 2. program counter
    • 3. register stack
    • 4. stack
  6. Name two things that threads share with other threads within the same process.
    • 1. code section
    • 2. data section
  7. Creating a thread is ______ _____ than creating a process under MacOSX/Linux and _____ ______ than creating a process under Windows.
    • - slightly cheaper
    • - much cheaper
  8. Context-switching between threads is ______ _____ than between processes
    slightly cheaper
  9. True/False: If one thread fails, then the process fails (and therefore the whole program).
    True
  10. Java Green Threads is a ______-level thread library to support threads in _____ Space.
    user, User
  11. Most modern OSes support ______ threads. In fact, Linux doesn't really make a difference between processes and threads (same data structure).
    kernel
  12. 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
  13. 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
  14. 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
  15. Two-Level Model:
    - User can say...?
    Example:
    - IRIX, HP-UX, Tru64 UNIX
    - Solaris 8 and earlier
    "Bind this thread to its own kernel thread"
  16. The Thread Library in C/C++ called Pthreads is implemented by the ______.
    kernel
  17. The Thread Library in C/C++ called OpenMP is a layer _____ Pthreads for convenient multi-threading in "easy" cases.
    above
  18. The Thread Library in Java called Java Threads is implemented by the ____, which relies on threads implemented by the ______.
    JVM, kernel
  19. 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()
  20. Name the possible thread state returned by getState():
    - A thread that hasn't been started yet
    NEW
  21. 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
  22. Name the possible thread state returned by getState():
    - The thread is blocked on a monitor
    BLOCKED
  23. Name the possible thread state returned by getState():
    - The thread is waiting for another thread to do something
    WAITING
  24. 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
  25. Name the possible thread state returned by getState():
    - The thread's run method has returned
    TERMINATED
Author
tulipyoursweety
ID
316718
Card Set
Operating Systems - Threads
Description
Threads, ICS 332, Spring 2016, Operating Systems
Updated