Operating System
  • Introduction
  • Chapter 1 Introduction
  • Chapter 2 Operating System Structures
  • Chapter 3 Processes
    • 3.1 Process Concept
    • 3.2 Process Scheduling
    • 3.3 Operation on Processes
    • 3.4 Interprocess Communication
  • Chapter 4 Threads
    • Summary: slides
    • 4.1 Overview
    • 4.2 Multithreading Models
    • 4.3 Thread Libraries
    • 4.4 Threading Issues
  • Chapter 6 Process Synchronization
    • 6.1 Background
    • 6.2 Critical-section problem
    • 6.3 Peterson's Solution
    • 6.4 Synchronization Hardware
    • 6.5 Semaphores
  • Summary ch1
  • Summary ch2
  • Summary ch3
  • Summary ch4
  • Summary ch5
  • Summary ch7
  • Summary ch6
  • Summary ch8
Powered by GitBook
On this page

Was this helpful?

  1. Chapter 4 Threads

4.4 Threading Issues

Previous4.3 Thread LibrariesNextChapter 6 Process Synchronization

Last updated 5 years ago

Was this helpful?

  1. If one thread in a program calls fork(), does the new process duplicate all threads, or is the new process single-threaded? Some UNIX systems have chosen to have two versions of fork().

    One that duplicates all threads and

    another that duplicates only the thread that invoked the fork() system call.

  2. The exec() system call typically works in the same way as described in Chapter 3. That is, if a thread invokes the exec() system call, the program specified in the parameter to exec() will replace the entire process—including all threads.

  3. Cancellation

    (1) Asynchronous cancellation. One thread immediately terminates the target thread.

    (2) Deferred cancellation. The target thread periodically checks whether it should terminate, allowing it an opportunity to terminate itself in an orderly fashion.

  4. Therefore, canceling a thread asynchronously may not free a necessary system-wide resource.

  5. Signal Handling

    (1) A signal is generated by the occurrence of a particular event.

    (2) A generated signal is delivered to a process.

    (3) Once delivered, the signal must be handled.

  6. Lightweight process (LWP)