Processes and Threads - PowerPoint PPT Presentation

About This Presentation
Title:

Processes and Threads

Description:

What is a Thread? A thread is similar to a process, but it typically consists of just the flow of ... Multiple threads use the address space of a single process. ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 12
Provided by: steve1831
Learn more at: https://owd.tcnj.edu
Category:

less

Transcript and Presenter's Notes

Title: Processes and Threads


1
What is a Thread?
A thread is similar to a process, but it
typically consists of just the flow of control.
Multiple threads use the address space of a
single process.
2
The Thread Model
  • (a) Three processes each with one thread
  • (b) One process with three threads

3
The Thread Model
  • Items shared by all threads in a process
  • Items private to each thread

4
The Thread Model
  • Each thread has its own stack

5
Why Do We Use Threads?
  • To simplify programs in which multiple activities
    go on at once.
  • Easier to create and destroy because they have no
    resources attached to them - they share common
    memory.
  • Performance gain, when there is substantial
    amounts of both computing and I/O.
  • A word processor with three threads

6
A multithreaded Web server
7
Rough outline of code for web server
  • (a) Dispatcher thread
  • (b) Worker thread

8
Three ways to construct a server
9
Implementing Threads in User Space
  • A user-level threads package

10
Implementing Threads in the Kernel
  • A threads package managed by the kernel

11
Hybrid Implementations
  • Multiplexing user-level threads onto kernel-
    level threads
Write a Comment
User Comments (0)
About PowerShow.com