SlideShare a Scribd company logo
Silberschatz, Galvin and Gagne ©20025.1
Chapter 5: Threads
Overview
Multithreading Models
Threading Issues
Pthreads
Solaris 2 Threads
Windows 2000 Threads
Linux Threads
Java Threads
Silberschatz, Galvin and Gagne ©20025.2
Single and Multithreaded
Processes
Silberschatz, Galvin and Gagne ©20025.3
Benefits
Responsiveness
Resource Sharing
Economy
Utilization of MP Architectures
Silberschatz, Galvin and Gagne ©20025.4
User Threads
Thread management done by user-level threads library
Examples
- POSIX Pthreads
- Mach C-threads
- Solaris threads
Silberschatz, Galvin and Gagne ©20025.5
Kernel Threads
Supported by the Kernel
Examples
- Windows 95/98/NT/2000
- Solaris
- Tru64 UNIX
- BeOS
- Linux
Silberschatz, Galvin and Gagne ©20025.6
Multithreading Models
Many-to-One
One-to-One
Many-to-Many
Silberschatz, Galvin and Gagne ©20025.7
Many-to-One
Many user-level threads mapped to single kernel thread.
Used on systems that do not support kernel threads.
Silberschatz, Galvin and Gagne ©20025.8
Many-to-One Model
Silberschatz, Galvin and Gagne ©20025.9
One-to-One
Each user-level thread maps to kernel thread.
Examples
- Windows 95/98/NT/2000
- OS/2
Silberschatz, Galvin and Gagne ©20025.10
One-to-one Model
Silberschatz, Galvin and Gagne ©20025.11
Many-to-Many Model
Allows many user level threads to be mapped to many
kernel threads.
Allows the operating system to create a sufficient number
of kernel threads.
Solaris 2
Windows NT/2000 with the ThreadFiber package
Silberschatz, Galvin and Gagne ©20025.12
Many-to-Many Model
Silberschatz, Galvin and Gagne ©20025.13
Threading Issues
Semantics of fork() and exec() system calls.
Thread cancellation.
Signal handling
Thread pools
Thread specific data
Silberschatz, Galvin and Gagne ©20025.14
Pthreads
a POSIX standard (IEEE 1003.1c) API for thread creation
and synchronization.
API specifies behavior of the thread library,
implementation is up to development of the library.
Common in UNIX operating systems.
Silberschatz, Galvin and Gagne ©20025.15
Solaris 2 Threads
Silberschatz, Galvin and Gagne ©20025.16
Solaris Process
Silberschatz, Galvin and Gagne ©20025.17
Windows 2000 Threads
Implements the one-to-one mapping.
Each thread contains
- a thread id
- register set
- separate user and kernel stacks
- private data storage area
Silberschatz, Galvin and Gagne ©20025.18
Linux Threads
Linux refers to them as tasks rather than threads.
Thread creation is done through clone() system call.
Clone() allows a child task to share the address space of
the parent task (process)
Silberschatz, Galvin and Gagne ©20025.19
Java Threads
Java threads may be created by:
Extending Thread class
Implementing the Runnable interface
Java threads are managed by the JVM.
Silberschatz, Galvin and Gagne ©20025.20
Java Thread States

More Related Content

PPTX
OpenStack & OpenContrail in Production
PPTX
Metrics towards enterprise readiness of unikernels
PPTX
Can the Open vSwitch (OVS) bottleneck be resolved? - Erez Cohen - OpenStack D...
PPTX
Network Monitoring and Analytics
PDF
Microservices for Enterprises - Consistent Network & Security services for Co...
PDF
NYC Docker Meetup: Contiv networking on Docker
PDF
Intro to OpenStack Astara (Spring '16)
OpenStack & OpenContrail in Production
Metrics towards enterprise readiness of unikernels
Can the Open vSwitch (OVS) bottleneck be resolved? - Erez Cohen - OpenStack D...
Network Monitoring and Analytics
Microservices for Enterprises - Consistent Network & Security services for Co...
NYC Docker Meetup: Contiv networking on Docker
Intro to OpenStack Astara (Spring '16)

What's hot (20)

PDF
CIF16: Unikernels, Meet Docker! Containing Unikernels (Richard Mortier, Anil ...
PPTX
BRKSDN-2115
PPTX
Superfluid Orchestration of heterogeneous Reusable Functional Blocks for 5G n...
PPTX
BRKDCT-2445 Agile OpenStack Networking with Cisco Solutions-Cisco Live! US 20...
PDF
Unified Underlay and Overlay SDNs for OpenStack Clouds
PDF
CIF16: Knock, Knock: Unikernels Calling! (Richard Mortier, Cambridge University)
PDF
Opensource approach to design and deployment of Microservices based VNF
PPTX
Revolutionizing IT and Telecom Industry with OpenStack, SDN and NFV
PDF
MidoNet Future -ミドネットの未来-
PDF
LF_OVS_17_OVN at Nutanix
PDF
CIF16: Unikernels: The Past, the Present, the Future ( Russell Pavlicek, Xen ...
PDF
Microservices Architectures with Docker Swarm, etcd, Kuryr and Neutron
PDF
XPDS14: MirageOS 2.0: branch consistency for Xen Stub Domains - Anil Madhavap...
PDF
Tacker - a generic VNF Manager using OpenStack
PPTX
Symantec SDN Deployment
PDF
IITCC15: Xen Project 4.6 Update
PDF
CIF16: Building the Superfluid Cloud with Unikernels (Simon Kuenzer, NEC Europe)
PPTX
NFV & SDN ( Efficiency & Automation )
PDF
Unikernel User Summit 2015: Getting started in unikernels using the rump kernel
PDF
Flexible NFV WAN interconnections with Neutron BGP VPN
CIF16: Unikernels, Meet Docker! Containing Unikernels (Richard Mortier, Anil ...
BRKSDN-2115
Superfluid Orchestration of heterogeneous Reusable Functional Blocks for 5G n...
BRKDCT-2445 Agile OpenStack Networking with Cisco Solutions-Cisco Live! US 20...
Unified Underlay and Overlay SDNs for OpenStack Clouds
CIF16: Knock, Knock: Unikernels Calling! (Richard Mortier, Cambridge University)
Opensource approach to design and deployment of Microservices based VNF
Revolutionizing IT and Telecom Industry with OpenStack, SDN and NFV
MidoNet Future -ミドネットの未来-
LF_OVS_17_OVN at Nutanix
CIF16: Unikernels: The Past, the Present, the Future ( Russell Pavlicek, Xen ...
Microservices Architectures with Docker Swarm, etcd, Kuryr and Neutron
XPDS14: MirageOS 2.0: branch consistency for Xen Stub Domains - Anil Madhavap...
Tacker - a generic VNF Manager using OpenStack
Symantec SDN Deployment
IITCC15: Xen Project 4.6 Update
CIF16: Building the Superfluid Cloud with Unikernels (Simon Kuenzer, NEC Europe)
NFV & SDN ( Efficiency & Automation )
Unikernel User Summit 2015: Getting started in unikernels using the rump kernel
Flexible NFV WAN interconnections with Neutron BGP VPN
Ad

Similar to Ch5 threads galvin (20)

PPT
Galvin-operating System(Ch5)
PPT
PPT
ch5.ppt
PPT
Operating System - Ch5
PPT
4.Threads
PPT
Ch5 OS
 
PPT
My DIaries
PPT
Ch4 Threads
PDF
threads-unit 1.pdf notes for ug students
PPT
Lecture on Java Programming for Beginners
PDF
Ch4 threads
PDF
Introduction to Threads, User and Kernel threads .pdf
PDF
Operating System : Ch4 b threads
PDF
Ch4 threads
PPTX
Threads are using in operating systems.pptx
PPT
ch4.ppt
PPT
PPT
Threads semaphoremutexlocksdeadlockp.ppt
Galvin-operating System(Ch5)
ch5.ppt
Operating System - Ch5
4.Threads
Ch5 OS
 
My DIaries
Ch4 Threads
threads-unit 1.pdf notes for ug students
Lecture on Java Programming for Beginners
Ch4 threads
Introduction to Threads, User and Kernel threads .pdf
Operating System : Ch4 b threads
Ch4 threads
Threads are using in operating systems.pptx
ch4.ppt
Threads semaphoremutexlocksdeadlockp.ppt
Ad

More from Shubham Singh (13)

PDF
Certificate of Completion
PDF
Certificate of Completion
PDF
Gmail google for education - certificate of achievement
PPTX
Transmission media 2
PPTX
Transmission media ppt
PPT
Wifi ppt
PPTX
Microprocessor 8085 complete
PPT
Ch9 Virtual Memory
PPT
Ch7 Process Synchronization galvin
PPT
Ch6 CPU Scheduling galvin
PPTX
Interrupt 8085
PPT
Chapter 3 instruction set-of-8085
PPTX
Chapter 1 microprocessor introduction
Certificate of Completion
Certificate of Completion
Gmail google for education - certificate of achievement
Transmission media 2
Transmission media ppt
Wifi ppt
Microprocessor 8085 complete
Ch9 Virtual Memory
Ch7 Process Synchronization galvin
Ch6 CPU Scheduling galvin
Interrupt 8085
Chapter 3 instruction set-of-8085
Chapter 1 microprocessor introduction

Recently uploaded (20)

PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Sustainable Sites - Green Building Construction
PPT
Project quality management in manufacturing
PDF
Well-logging-methods_new................
PPTX
additive manufacturing of ss316l using mig welding
PDF
composite construction of structures.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Geodesy 1.pptx...............................................
PPTX
Welding lecture in detail for understanding
R24 SURVEYING LAB MANUAL for civil enggi
OOP with Java - Java Introduction (Basics)
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Lecture Notes Electrical Wiring System Components
Sustainable Sites - Green Building Construction
Project quality management in manufacturing
Well-logging-methods_new................
additive manufacturing of ss316l using mig welding
composite construction of structures.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Foundation to blockchain - A guide to Blockchain Tech
Model Code of Practice - Construction Work - 21102022 .pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Embodied AI: Ushering in the Next Era of Intelligent Systems
Geodesy 1.pptx...............................................
Welding lecture in detail for understanding

Ch5 threads galvin

  • 1. Silberschatz, Galvin and Gagne ©20025.1 Chapter 5: Threads Overview Multithreading Models Threading Issues Pthreads Solaris 2 Threads Windows 2000 Threads Linux Threads Java Threads
  • 2. Silberschatz, Galvin and Gagne ©20025.2 Single and Multithreaded Processes
  • 3. Silberschatz, Galvin and Gagne ©20025.3 Benefits Responsiveness Resource Sharing Economy Utilization of MP Architectures
  • 4. Silberschatz, Galvin and Gagne ©20025.4 User Threads Thread management done by user-level threads library Examples - POSIX Pthreads - Mach C-threads - Solaris threads
  • 5. Silberschatz, Galvin and Gagne ©20025.5 Kernel Threads Supported by the Kernel Examples - Windows 95/98/NT/2000 - Solaris - Tru64 UNIX - BeOS - Linux
  • 6. Silberschatz, Galvin and Gagne ©20025.6 Multithreading Models Many-to-One One-to-One Many-to-Many
  • 7. Silberschatz, Galvin and Gagne ©20025.7 Many-to-One Many user-level threads mapped to single kernel thread. Used on systems that do not support kernel threads.
  • 8. Silberschatz, Galvin and Gagne ©20025.8 Many-to-One Model
  • 9. Silberschatz, Galvin and Gagne ©20025.9 One-to-One Each user-level thread maps to kernel thread. Examples - Windows 95/98/NT/2000 - OS/2
  • 10. Silberschatz, Galvin and Gagne ©20025.10 One-to-one Model
  • 11. Silberschatz, Galvin and Gagne ©20025.11 Many-to-Many Model Allows many user level threads to be mapped to many kernel threads. Allows the operating system to create a sufficient number of kernel threads. Solaris 2 Windows NT/2000 with the ThreadFiber package
  • 12. Silberschatz, Galvin and Gagne ©20025.12 Many-to-Many Model
  • 13. Silberschatz, Galvin and Gagne ©20025.13 Threading Issues Semantics of fork() and exec() system calls. Thread cancellation. Signal handling Thread pools Thread specific data
  • 14. Silberschatz, Galvin and Gagne ©20025.14 Pthreads a POSIX standard (IEEE 1003.1c) API for thread creation and synchronization. API specifies behavior of the thread library, implementation is up to development of the library. Common in UNIX operating systems.
  • 15. Silberschatz, Galvin and Gagne ©20025.15 Solaris 2 Threads
  • 16. Silberschatz, Galvin and Gagne ©20025.16 Solaris Process
  • 17. Silberschatz, Galvin and Gagne ©20025.17 Windows 2000 Threads Implements the one-to-one mapping. Each thread contains - a thread id - register set - separate user and kernel stacks - private data storage area
  • 18. Silberschatz, Galvin and Gagne ©20025.18 Linux Threads Linux refers to them as tasks rather than threads. Thread creation is done through clone() system call. Clone() allows a child task to share the address space of the parent task (process)
  • 19. Silberschatz, Galvin and Gagne ©20025.19 Java Threads Java threads may be created by: Extending Thread class Implementing the Runnable interface Java threads are managed by the JVM.
  • 20. Silberschatz, Galvin and Gagne ©20025.20 Java Thread States