SlideShare a Scribd company logo
1 of 21
Download to read offline
Silberschatz, Galvin and Gagne 20025.1Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.1
1 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
O P E R A T I N G S Y S T E M S
Module 4b : Thread
• Overview
• Multithreading Models
• Threading Issues
• Pthreads
• Solaris 2 Threads
• Windows 2000 Threads
• Linux Threads
• Java Threads
Silberschatz, Galvin and Gagne 20025.2Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.2
2 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
Module 4: Threads
 Overview
 Multithreading Models
 Threading Issues
 Pthreads
 Solaris 2 Threads
 Windows 2000 Threads
 Linux Threads
 Java Threads
Silberschatz, Galvin and Gagne 20025.3Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.3
3 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
Single and Multithreaded Processes
Silberschatz, Galvin and Gagne 20025.4Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.4
4 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
Benefits
 Responsiveness
 Resource Sharing
 Economy
 Utilization of MP Architectures
Silberschatz, Galvin and Gagne 20025.5Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.5
5 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
User Threads
 Thread management done by user-level threads library
 Examples
- POSIX Pthreads
- Mach C-threads
- Solaris threads
Silberschatz, Galvin and Gagne 20025.6Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.6
6 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
Kernel Threads
 Supported by the Kernel
 Examples
- Windows 95/98/NT/2000
- Solaris
- Tru64 UNIX
- BeOS
- Linux
Silberschatz, Galvin and Gagne 20025.7Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.7
7 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
Multithreading Models
 Many-to-One
 One-to-One
 Many-to-Many
Silberschatz, Galvin and Gagne 20025.8Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.8
8 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
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.9Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.9
9 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
Many-to-One Model
Silberschatz, Galvin and Gagne 20025.10Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.10
10 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
One-to-One
 Each user-level thread maps to kernel thread.
 Examples
- Windows 95/98/NT/2000
- OS/2
Silberschatz, Galvin and Gagne 20025.11Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.11
11 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
One-to-one Model
Silberschatz, Galvin and Gagne 20025.12Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.12
12 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
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.13Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.13
13 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
Many-to-Many Model
Silberschatz, Galvin and Gagne 20025.14Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.14
14 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
Threading Issues
 Semantics of fork() and exec() system calls.
 Thread cancellation.
 Signal handling
 Thread pools
 Thread specific data
Silberschatz, Galvin and Gagne 20025.15Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.15
15 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
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.16Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.16
16 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
Solaris 2 Threads
Silberschatz, Galvin and Gagne 20025.17Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.17
17 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
Solaris Process
Silberschatz, Galvin and Gagne 20025.18Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.18
18 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
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.19Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.19
19 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
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.20Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.20
20 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
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.21Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.21
21 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21
Java Thread States

More Related Content

Similar to Operating System : Ch4 b threads

Galvin-operating System(Ch5)
Galvin-operating System(Ch5)Galvin-operating System(Ch5)
Galvin-operating System(Ch5)dsuyal1
 
Operating System : Ch12 io systems
Operating System : Ch12 io systemsOperating System : Ch12 io systems
Operating System : Ch12 io systemsSyaiful Ahdan
 
Ch5: Threads (Operating System)
Ch5: Threads (Operating System)Ch5: Threads (Operating System)
Ch5: Threads (Operating System)Ahmar Hashmi
 
Operating System : Ch13 secondary storage
Operating System : Ch13 secondary storageOperating System : Ch13 secondary storage
Operating System : Ch13 secondary storageSyaiful Ahdan
 
Operating System : Ch16.distributed system structures
Operating System : Ch16.distributed system structuresOperating System : Ch16.distributed system structures
Operating System : Ch16.distributed system structuresSyaiful Ahdan
 
Ch11 file system interface
Ch11 file system interfaceCh11 file system interface
Ch11 file system interfaceSyaiful Ahdan
 
Operating System : Ch15 network structures
Operating System : Ch15 network structuresOperating System : Ch15 network structures
Operating System : Ch15 network structuresSyaiful Ahdan
 
Ch10.1 secondary storage
Ch10.1 secondary storageCh10.1 secondary storage
Ch10.1 secondary storageSyaiful Ahdan
 
Operating System : Ch10 file system interface
Operating System : Ch10 file system interfaceOperating System : Ch10 file system interface
Operating System : Ch10 file system interfaceSyaiful Ahdan
 
Operating System : Ch20 security
Operating System : Ch20 securityOperating System : Ch20 security
Operating System : Ch20 securitySyaiful Ahdan
 
Operating System : Ch14.tertiary storage structure
Operating System : Ch14.tertiary storage structureOperating System : Ch14.tertiary storage structure
Operating System : Ch14.tertiary storage structureSyaiful Ahdan
 
Operating System : Ch17 distributed file systems
Operating System : Ch17 distributed file systemsOperating System : Ch17 distributed file systems
Operating System : Ch17 distributed file systemsSyaiful Ahdan
 
Operating System - Ch5
Operating System - Ch5Operating System - Ch5
Operating System - Ch5Resty Aldana
 

Similar to Operating System : Ch4 b threads (20)

Materi8mainmemory
Materi8mainmemoryMateri8mainmemory
Materi8mainmemory
 
Ch8 main memory
Ch8 main memoryCh8 main memory
Ch8 main memory
 
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 : Ch12 io systems
Operating System : Ch12 io systemsOperating System : Ch12 io systems
Operating System : Ch12 io systems
 
Ch5 threads galvin
Ch5 threads  galvinCh5 threads  galvin
Ch5 threads galvin
 
Ch5: Threads (Operating System)
Ch5: Threads (Operating System)Ch5: Threads (Operating System)
Ch5: Threads (Operating System)
 
Ch14 protection
Ch14 protectionCh14 protection
Ch14 protection
 
Operating System : Ch13 secondary storage
Operating System : Ch13 secondary storageOperating System : Ch13 secondary storage
Operating System : Ch13 secondary storage
 
Operating System : Ch16.distributed system structures
Operating System : Ch16.distributed system structuresOperating System : Ch16.distributed system structures
Operating System : Ch16.distributed system structures
 
Ch11 file system interface
Ch11 file system interfaceCh11 file system interface
Ch11 file system interface
 
Ch13 io systems
Ch13 io systemsCh13 io systems
Ch13 io systems
 
Operating System : Ch15 network structures
Operating System : Ch15 network structuresOperating System : Ch15 network structures
Operating System : Ch15 network structures
 
Ch10.1 secondary storage
Ch10.1 secondary storageCh10.1 secondary storage
Ch10.1 secondary storage
 
Operating System : Ch10 file system interface
Operating System : Ch10 file system interfaceOperating System : Ch10 file system interface
Operating System : Ch10 file system interface
 
Operating System : Ch20 security
Operating System : Ch20 securityOperating System : Ch20 security
Operating System : Ch20 security
 
Operating System : Ch14.tertiary storage structure
Operating System : Ch14.tertiary storage structureOperating System : Ch14.tertiary storage structure
Operating System : Ch14.tertiary storage structure
 
Ch15 security
Ch15 securityCh15 security
Ch15 security
 
Operating System : Ch17 distributed file systems
Operating System : Ch17 distributed file systemsOperating System : Ch17 distributed file systems
Operating System : Ch17 distributed file systems
 
Operating System - Ch5
Operating System - Ch5Operating System - Ch5
Operating System - Ch5
 

More from Syaiful Ahdan

Sertifikat EC00202128391
 Sertifikat EC00202128391 Sertifikat EC00202128391
Sertifikat EC00202128391Syaiful Ahdan
 
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...Syaiful Ahdan
 
Sertifikat ec00202059774
Sertifikat ec00202059774Sertifikat ec00202059774
Sertifikat ec00202059774Syaiful Ahdan
 
Sertifikat ec00202059775
Sertifikat ec00202059775Sertifikat ec00202059775
Sertifikat ec00202059775Syaiful Ahdan
 
Sertifikat EC00202045078
Sertifikat EC00202045078Sertifikat EC00202045078
Sertifikat EC00202045078Syaiful Ahdan
 
Sertifikat EC00202044723
 Sertifikat EC00202044723 Sertifikat EC00202044723
Sertifikat EC00202044723Syaiful Ahdan
 
Sertifikat EC00202023523
Sertifikat EC00202023523Sertifikat EC00202023523
Sertifikat EC00202023523Syaiful Ahdan
 
Sertifikat EC00201826309
Sertifikat EC00201826309Sertifikat EC00201826309
Sertifikat EC00201826309Syaiful Ahdan
 
Sertifikat EC00202023149
Sertifikat EC00202023149Sertifikat EC00202023149
Sertifikat EC00202023149Syaiful Ahdan
 
Sertifikat EC00202022868
Sertifikat EC00202022868Sertifikat EC00202022868
Sertifikat EC00202022868Syaiful Ahdan
 
Sertifikat EC00202021343
Sertifikat EC00202021343Sertifikat EC00202021343
Sertifikat EC00202021343Syaiful Ahdan
 
Sertifikat EC00202022755
Sertifikat EC00202022755Sertifikat EC00202022755
Sertifikat EC00202022755Syaiful Ahdan
 
Sertifikat EC00201987196
Sertifikat EC00201987196Sertifikat EC00201987196
Sertifikat EC00201987196Syaiful Ahdan
 
Sertifikat EC00201856484
Sertifikat EC00201856484Sertifikat EC00201856484
Sertifikat EC00201856484Syaiful Ahdan
 
Sertifikat EC00201856352
Sertifikat EC00201856352Sertifikat EC00201856352
Sertifikat EC00201856352Syaiful Ahdan
 
Sertifikat EC00201856994
Sertifikat EC00201856994Sertifikat EC00201856994
Sertifikat EC00201856994Syaiful Ahdan
 
Sertifikat EC00201856895
Sertifikat EC00201856895Sertifikat EC00201856895
Sertifikat EC00201856895Syaiful Ahdan
 
Meeting 2 introdcution network administrator
Meeting 2   introdcution network administratorMeeting 2   introdcution network administrator
Meeting 2 introdcution network administratorSyaiful Ahdan
 

More from Syaiful Ahdan (20)

Sertifikat EC00202128391
 Sertifikat EC00202128391 Sertifikat EC00202128391
Sertifikat EC00202128391
 
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
 
Sertifikat ec00202059774
Sertifikat ec00202059774Sertifikat ec00202059774
Sertifikat ec00202059774
 
Sertifikat ec00202059775
Sertifikat ec00202059775Sertifikat ec00202059775
Sertifikat ec00202059775
 
Sertifikat EC00202045078
Sertifikat EC00202045078Sertifikat EC00202045078
Sertifikat EC00202045078
 
Sertifikat EC00202044723
 Sertifikat EC00202044723 Sertifikat EC00202044723
Sertifikat EC00202044723
 
Sertifikat EC00202023523
Sertifikat EC00202023523Sertifikat EC00202023523
Sertifikat EC00202023523
 
Sertifikat EC00201826309
Sertifikat EC00201826309Sertifikat EC00201826309
Sertifikat EC00201826309
 
Sertifikat EC00202023149
Sertifikat EC00202023149Sertifikat EC00202023149
Sertifikat EC00202023149
 
Sertifikat EC00202022868
Sertifikat EC00202022868Sertifikat EC00202022868
Sertifikat EC00202022868
 
Sertifikat EC00202021343
Sertifikat EC00202021343Sertifikat EC00202021343
Sertifikat EC00202021343
 
Sertifikat EC00202022755
Sertifikat EC00202022755Sertifikat EC00202022755
Sertifikat EC00202022755
 
Sertifikat EC00201987196
Sertifikat EC00201987196Sertifikat EC00201987196
Sertifikat EC00201987196
 
Sertifikat EC00201856484
Sertifikat EC00201856484Sertifikat EC00201856484
Sertifikat EC00201856484
 
Sertifikat EC00201856352
Sertifikat EC00201856352Sertifikat EC00201856352
Sertifikat EC00201856352
 
Sertifikat EC00201856994
Sertifikat EC00201856994Sertifikat EC00201856994
Sertifikat EC00201856994
 
Sertifikat EC00201856895
Sertifikat EC00201856895Sertifikat EC00201856895
Sertifikat EC00201856895
 
Meeting 2 introdcution network administrator
Meeting 2   introdcution network administratorMeeting 2   introdcution network administrator
Meeting 2 introdcution network administrator
 
Pertemuan 5
Pertemuan 5Pertemuan 5
Pertemuan 5
 
Pertemuan 4
Pertemuan 4Pertemuan 4
Pertemuan 4
 

Recently uploaded

Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
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
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
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
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
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
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Recently uploaded (20)

Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
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
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
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
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
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
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

Operating System : Ch4 b threads

  • 1. Silberschatz, Galvin and Gagne 20025.1Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.1 1 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 O P E R A T I N G S Y S T E M S Module 4b : Thread • Overview • Multithreading Models • Threading Issues • Pthreads • Solaris 2 Threads • Windows 2000 Threads • Linux Threads • Java Threads
  • 2. Silberschatz, Galvin and Gagne 20025.2Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.2 2 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Module 4: Threads  Overview  Multithreading Models  Threading Issues  Pthreads  Solaris 2 Threads  Windows 2000 Threads  Linux Threads  Java Threads
  • 3. Silberschatz, Galvin and Gagne 20025.3Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.3 3 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Single and Multithreaded Processes
  • 4. Silberschatz, Galvin and Gagne 20025.4Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.4 4 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Benefits  Responsiveness  Resource Sharing  Economy  Utilization of MP Architectures
  • 5. Silberschatz, Galvin and Gagne 20025.5Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.5 5 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 User Threads  Thread management done by user-level threads library  Examples - POSIX Pthreads - Mach C-threads - Solaris threads
  • 6. Silberschatz, Galvin and Gagne 20025.6Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.6 6 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Kernel Threads  Supported by the Kernel  Examples - Windows 95/98/NT/2000 - Solaris - Tru64 UNIX - BeOS - Linux
  • 7. Silberschatz, Galvin and Gagne 20025.7Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.7 7 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Multithreading Models  Many-to-One  One-to-One  Many-to-Many
  • 8. Silberschatz, Galvin and Gagne 20025.8Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.8 8 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Many-to-One  Many user-level threads mapped to single kernel thread.  Used on systems that do not support kernel threads.
  • 9. Silberschatz, Galvin and Gagne 20025.9Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.9 9 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Many-to-One Model
  • 10. Silberschatz, Galvin and Gagne 20025.10Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.10 10 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 One-to-One  Each user-level thread maps to kernel thread.  Examples - Windows 95/98/NT/2000 - OS/2
  • 11. Silberschatz, Galvin and Gagne 20025.11Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.11 11 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 One-to-one Model
  • 12. Silberschatz, Galvin and Gagne 20025.12Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.12 12 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 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
  • 13. Silberschatz, Galvin and Gagne 20025.13Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.13 13 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Many-to-Many Model
  • 14. Silberschatz, Galvin and Gagne 20025.14Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.14 14 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Threading Issues  Semantics of fork() and exec() system calls.  Thread cancellation.  Signal handling  Thread pools  Thread specific data
  • 15. Silberschatz, Galvin and Gagne 20025.15Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.15 15 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 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.
  • 16. Silberschatz, Galvin and Gagne 20025.16Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.16 16 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Solaris 2 Threads
  • 17. Silberschatz, Galvin and Gagne 20025.17Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.17 17 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Solaris Process
  • 18. Silberschatz, Galvin and Gagne 20025.18Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.18 18 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 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
  • 19. Silberschatz, Galvin and Gagne 20025.19Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.19 19 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 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)
  • 20. Silberschatz, Galvin and Gagne 20025.20Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.20 20 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Java Threads  Java threads may be created by:  Extending Thread class  Implementing the Runnable interface  Java threads are managed by the JVM.
  • 21. Silberschatz, Galvin and Gagne 20025.21Operating System ConceptsOperating System Concepts Silberschatz and Galvin 19994.21 21 toOperating System Concepts | Silberschatz and Galvin 1999https://github.com/syaifulahdan/ 21 Java Thread States