SlideShare une entreprise Scribd logo
1  sur  20
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

Contenu connexe

Tendances

Chapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatzChapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatzGiulianoRanauro
 
Software Cost Estimation Techniques
Software Cost Estimation TechniquesSoftware Cost Estimation Techniques
Software Cost Estimation TechniquesSanthi thi
 
Unit II - 2 - Operating System - Threads
Unit II - 2 - Operating System - ThreadsUnit II - 2 - Operating System - Threads
Unit II - 2 - Operating System - Threadscscarcas
 
Software maintenance Unit5
Software maintenance  Unit5Software maintenance  Unit5
Software maintenance Unit5Mohammad Faizan
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-GalvinSonali Chauhan
 
Chapter 2: Operating System Structures
Chapter 2: Operating System StructuresChapter 2: Operating System Structures
Chapter 2: Operating System StructuresShafaan Khaliq Bhatti
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt onu9
 
Chapter 01 software engineering pressman
Chapter 01  software engineering pressmanChapter 01  software engineering pressman
Chapter 01 software engineering pressmanRohitGoyal183
 
RE processes and process models
RE processes and process modelsRE processes and process models
RE processes and process modelsSyed Zaid Irshad
 
Software Process Models
Software Process ModelsSoftware Process Models
Software Process ModelsAtul Karmyal
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)Prakhar Maurya
 
Operating systems chapter 5 silberschatz
Operating systems chapter 5 silberschatzOperating systems chapter 5 silberschatz
Operating systems chapter 5 silberschatzGiulianoRanauro
 

Tendances (20)

Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
Prototyping model
Prototyping modelPrototyping model
Prototyping model
 
RAD Model
RAD ModelRAD Model
RAD Model
 
Chapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatzChapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatz
 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
 
Software Cost Estimation Techniques
Software Cost Estimation TechniquesSoftware Cost Estimation Techniques
Software Cost Estimation Techniques
 
Ch1-Operating System Concept
Ch1-Operating System ConceptCh1-Operating System Concept
Ch1-Operating System Concept
 
Software development process models
Software development process modelsSoftware development process models
Software development process models
 
Case study linux
Case study linuxCase study linux
Case study linux
 
Unit II - 2 - Operating System - Threads
Unit II - 2 - Operating System - ThreadsUnit II - 2 - Operating System - Threads
Unit II - 2 - Operating System - Threads
 
Software maintenance Unit5
Software maintenance  Unit5Software maintenance  Unit5
Software maintenance Unit5
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
 
Chapter 2: Operating System Structures
Chapter 2: Operating System StructuresChapter 2: Operating System Structures
Chapter 2: Operating System Structures
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 
Chapter 01 software engineering pressman
Chapter 01  software engineering pressmanChapter 01  software engineering pressman
Chapter 01 software engineering pressman
 
RE processes and process models
RE processes and process modelsRE processes and process models
RE processes and process models
 
Software Process Models
Software Process ModelsSoftware Process Models
Software Process Models
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Threads
ThreadsThreads
Threads
 
Operating systems chapter 5 silberschatz
Operating systems chapter 5 silberschatzOperating systems chapter 5 silberschatz
Operating systems chapter 5 silberschatz
 

Similaire à Ch5: Threads (Operating System)

Similaire à Ch5: Threads (Operating System) (20)

ch5.ppt
ch5.pptch5.ppt
ch5.ppt
 
Galvin-operating System(Ch5)
Galvin-operating System(Ch5)Galvin-operating System(Ch5)
Galvin-operating System(Ch5)
 
Operating System : Ch4 b threads
Operating System : Ch4 b threadsOperating System : Ch4 b threads
Operating System : Ch4 b threads
 
Ch4 threads
Ch4 threadsCh4 threads
Ch4 threads
 
OS_Ch5
OS_Ch5OS_Ch5
OS_Ch5
 
OSCh5
OSCh5OSCh5
OSCh5
 
Ch5 OS
Ch5 OSCh5 OS
Ch5 OS
 
Ch4 threads
Ch4  threadsCh4  threads
Ch4 threads
 
Threads are using in operating systems.pptx
Threads are using in operating systems.pptxThreads are using in operating systems.pptx
Threads are using in operating systems.pptx
 
Operating System - Ch5
Operating System - Ch5Operating System - Ch5
Operating System - Ch5
 
My DIaries
My DIariesMy DIaries
My DIaries
 
ch4.pptx
ch4.pptxch4.pptx
ch4.pptx
 
ch4.pptx
ch4.pptxch4.pptx
ch4.pptx
 
Threads & Concurrency
Threads & Concurrency Threads & Concurrency
Threads & Concurrency
 
4 threads
4 threads4 threads
4 threads
 
ch4.ppt
ch4.pptch4.ppt
ch4.ppt
 
ch4.ppt
ch4.pptch4.ppt
ch4.ppt
 
Threads semaphoremutexlocksdeadlockp.ppt
Threads semaphoremutexlocksdeadlockp.pptThreads semaphoremutexlocksdeadlockp.ppt
Threads semaphoremutexlocksdeadlockp.ppt
 
ch4.ppt operation system. Dats structure and alogor
ch4.ppt operation system. Dats structure and alogorch4.ppt operation system. Dats structure and alogor
ch4.ppt operation system. Dats structure and alogor
 
ch4.ppt
ch4.pptch4.ppt
ch4.ppt
 

Plus de Ahmar Hashmi

32 Security in_Internet_IP_SEC_SSL/TLS_PGN_VPN_and_Firewalls
32 Security in_Internet_IP_SEC_SSL/TLS_PGN_VPN_and_Firewalls32 Security in_Internet_IP_SEC_SSL/TLS_PGN_VPN_and_Firewalls
32 Security in_Internet_IP_SEC_SSL/TLS_PGN_VPN_and_FirewallsAhmar Hashmi
 
31 Network Security
31 Network Security31 Network Security
31 Network SecurityAhmar Hashmi
 
28 Network Management_SNMP
28 Network Management_SNMP28 Network Management_SNMP
28 Network Management_SNMPAhmar Hashmi
 
26 Remote Logging_Electronic_Mail_and_File_Transfer
26 Remote Logging_Electronic_Mail_and_File_Transfer26 Remote Logging_Electronic_Mail_and_File_Transfer
26 Remote Logging_Electronic_Mail_and_File_TransferAhmar Hashmi
 
24 Congestion Control_and_Quality_of_Service
24 Congestion Control_and_Quality_of_Service24 Congestion Control_and_Quality_of_Service
24 Congestion Control_and_Quality_of_ServiceAhmar Hashmi
 
23 Process to_Process_Delivery_UDP_TCP_and_SCTP
23 Process to_Process_Delivery_UDP_TCP_and_SCTP23 Process to_Process_Delivery_UDP_TCP_and_SCTP
23 Process to_Process_Delivery_UDP_TCP_and_SCTPAhmar Hashmi
 
22 Network Layer_Delivery_forwarding_and_Routing
22 Network Layer_Delivery_forwarding_and_Routing22 Network Layer_Delivery_forwarding_and_Routing
22 Network Layer_Delivery_forwarding_and_RoutingAhmar Hashmi
 
21 Network Layer_Address_Mapping_Error_Reporting_and_Multicasting
21 Network Layer_Address_Mapping_Error_Reporting_and_Multicasting21 Network Layer_Address_Mapping_Error_Reporting_and_Multicasting
21 Network Layer_Address_Mapping_Error_Reporting_and_MulticastingAhmar Hashmi
 
20 Network Layer_Internet_Protocol
20 Network Layer_Internet_Protocol20 Network Layer_Internet_Protocol
20 Network Layer_Internet_ProtocolAhmar Hashmi
 
19 Network Layer_Logical_Addressing
19 Network Layer_Logical_Addressing19 Network Layer_Logical_Addressing
19 Network Layer_Logical_AddressingAhmar Hashmi
 
18 Virtual Circuit_Networks_Frame_Relay_and_ATM
18 Virtual Circuit_Networks_Frame_Relay_and_ATM18 Virtual Circuit_Networks_Frame_Relay_and_ATM
18 Virtual Circuit_Networks_Frame_Relay_and_ATMAhmar Hashmi
 
16 Wireless WANs_Cellular_Telephone_and_Satellite_Networks
16 Wireless WANs_Cellular_Telephone_and_Satellite_Networks16 Wireless WANs_Cellular_Telephone_and_Satellite_Networks
16 Wireless WANs_Cellular_Telephone_and_Satellite_NetworksAhmar Hashmi
 
15 Connecting LANs_Backbone_Networks_and_Virtual_LAN
15 Connecting LANs_Backbone_Networks_and_Virtual_LAN15 Connecting LANs_Backbone_Networks_and_Virtual_LAN
15 Connecting LANs_Backbone_Networks_and_Virtual_LANAhmar Hashmi
 
13 Wired Lans_Ethernet
13 Wired Lans_Ethernet13 Wired Lans_Ethernet
13 Wired Lans_EthernetAhmar Hashmi
 

Plus de Ahmar Hashmi (20)

32 Security in_Internet_IP_SEC_SSL/TLS_PGN_VPN_and_Firewalls
32 Security in_Internet_IP_SEC_SSL/TLS_PGN_VPN_and_Firewalls32 Security in_Internet_IP_SEC_SSL/TLS_PGN_VPN_and_Firewalls
32 Security in_Internet_IP_SEC_SSL/TLS_PGN_VPN_and_Firewalls
 
31 Network Security
31 Network Security31 Network Security
31 Network Security
 
30 Cryptography
30 Cryptography30 Cryptography
30 Cryptography
 
29 Multimedia
29 Multimedia29 Multimedia
29 Multimedia
 
28 Network Management_SNMP
28 Network Management_SNMP28 Network Management_SNMP
28 Network Management_SNMP
 
27 WWW and_HTTP
27 WWW and_HTTP27 WWW and_HTTP
27 WWW and_HTTP
 
26 Remote Logging_Electronic_Mail_and_File_Transfer
26 Remote Logging_Electronic_Mail_and_File_Transfer26 Remote Logging_Electronic_Mail_and_File_Transfer
26 Remote Logging_Electronic_Mail_and_File_Transfer
 
25 DNS
25 DNS25 DNS
25 DNS
 
24 Congestion Control_and_Quality_of_Service
24 Congestion Control_and_Quality_of_Service24 Congestion Control_and_Quality_of_Service
24 Congestion Control_and_Quality_of_Service
 
23 Process to_Process_Delivery_UDP_TCP_and_SCTP
23 Process to_Process_Delivery_UDP_TCP_and_SCTP23 Process to_Process_Delivery_UDP_TCP_and_SCTP
23 Process to_Process_Delivery_UDP_TCP_and_SCTP
 
22 Network Layer_Delivery_forwarding_and_Routing
22 Network Layer_Delivery_forwarding_and_Routing22 Network Layer_Delivery_forwarding_and_Routing
22 Network Layer_Delivery_forwarding_and_Routing
 
21 Network Layer_Address_Mapping_Error_Reporting_and_Multicasting
21 Network Layer_Address_Mapping_Error_Reporting_and_Multicasting21 Network Layer_Address_Mapping_Error_Reporting_and_Multicasting
21 Network Layer_Address_Mapping_Error_Reporting_and_Multicasting
 
20 Network Layer_Internet_Protocol
20 Network Layer_Internet_Protocol20 Network Layer_Internet_Protocol
20 Network Layer_Internet_Protocol
 
19 Network Layer_Logical_Addressing
19 Network Layer_Logical_Addressing19 Network Layer_Logical_Addressing
19 Network Layer_Logical_Addressing
 
18 Virtual Circuit_Networks_Frame_Relay_and_ATM
18 Virtual Circuit_Networks_Frame_Relay_and_ATM18 Virtual Circuit_Networks_Frame_Relay_and_ATM
18 Virtual Circuit_Networks_Frame_Relay_and_ATM
 
17 SONET/SDH
17 SONET/SDH17 SONET/SDH
17 SONET/SDH
 
16 Wireless WANs_Cellular_Telephone_and_Satellite_Networks
16 Wireless WANs_Cellular_Telephone_and_Satellite_Networks16 Wireless WANs_Cellular_Telephone_and_Satellite_Networks
16 Wireless WANs_Cellular_Telephone_and_Satellite_Networks
 
15 Connecting LANs_Backbone_Networks_and_Virtual_LAN
15 Connecting LANs_Backbone_Networks_and_Virtual_LAN15 Connecting LANs_Backbone_Networks_and_Virtual_LAN
15 Connecting LANs_Backbone_Networks_and_Virtual_LAN
 
14 Wireless LAN
14 Wireless LAN14 Wireless LAN
14 Wireless LAN
 
13 Wired Lans_Ethernet
13 Wired Lans_Ethernet13 Wired Lans_Ethernet
13 Wired Lans_Ethernet
 

Dernier

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 

Dernier (20)

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

Ch5: Threads (Operating System)

  • 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