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
Chapter 4 : 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
Chapter 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

PDF
Ch5 process synchronization
PDF
Operating System-Ch4.processes
PDF
Operating System : Ch19 protection
PDF
Operating System : Ch4 b threads
PDF
Ch14 protection
PDF
Ch5 cpu scheduling
PDF
Operating System-Ch5 cpu scheduling
PDF
Operating System : Ch12 io systems
Ch5 process synchronization
Operating System-Ch4.processes
Operating System : Ch19 protection
Operating System : Ch4 b threads
Ch14 protection
Ch5 cpu scheduling
Operating System-Ch5 cpu scheduling
Operating System : Ch12 io systems

What's hot (19)

PDF
Ch13 io systems
PDF
Operating System-Ch6 process synchronization
PPT
Galvin-operating System(Ch6)
PPT
Galvin-operating System(Ch4)
PDF
Ch10.1 secondary storage
PDF
Ch10.2.tertiary storage structure
PDF
Synchronization
PPT
Galvin-operating System(Ch7)
PPT
Process synchonization : operating system ( Btech cse )
PPT
Galvin-operating System(Ch8)
PPT
Lecture#5
PPT
Ch7 Process Synchronization galvin
PPT
Deadlock : operating system ( BTECH CSE )
PPT
Lec11 semaphores
PDF
Real Time Application Interface for Linux
PPT
Memory : operating system ( Btech cse )
PDF
Osdc2014 openstack networking yves_fauser
PDF
BKK16-502 Suspend to Idle
PDF
OPNFV Developer Tools and Release Process
Ch13 io systems
Operating System-Ch6 process synchronization
Galvin-operating System(Ch6)
Galvin-operating System(Ch4)
Ch10.1 secondary storage
Ch10.2.tertiary storage structure
Synchronization
Galvin-operating System(Ch7)
Process synchonization : operating system ( Btech cse )
Galvin-operating System(Ch8)
Lecture#5
Ch7 Process Synchronization galvin
Deadlock : operating system ( BTECH CSE )
Lec11 semaphores
Real Time Application Interface for Linux
Memory : operating system ( Btech cse )
Osdc2014 openstack networking yves_fauser
BKK16-502 Suspend to Idle
OPNFV Developer Tools and Release Process
Ad

Similar to Ch4 threads (20)

PPT
ch5.ppt
PPT
OS-operating systems- ch04 (Threads) ...
PDF
Introduction to Threads, User and Kernel threads .pdf
PPT
Operating Systems Chapter 4444444444.ppt
PPTX
Threads are using in operating systems.pptx
PDF
Unit II - 2 - Operating System - Threads
PPT
CSW355-OS-ch4-1111111111111111111111.ppt
PPT
ch4.ppt
PPT
ch4.ppt operation system. Dats structure and alogor
PPT
PPT
Threads semaphoremutexlocksdeadlockp.ppt
PDF
Ch4 threads
PPT
4.Threads
PPT
Verses: 110 Revealed in: Makkah Main Lesson: Allah’s guidance protects us f...
PPT
Chapter 4 Threads used in operating s.ppt
PPT
Unit 2-ch4-Threads-CPU- Operating Systems
PPT
Unit 2-ch4-Threads concept in Operating systems
PPT
chapter 4 introduction to powerpoint .ppt
PPT
Threads in the Operating System for OS..
ch5.ppt
OS-operating systems- ch04 (Threads) ...
Introduction to Threads, User and Kernel threads .pdf
Operating Systems Chapter 4444444444.ppt
Threads are using in operating systems.pptx
Unit II - 2 - Operating System - Threads
CSW355-OS-ch4-1111111111111111111111.ppt
ch4.ppt
ch4.ppt operation system. Dats structure and alogor
Threads semaphoremutexlocksdeadlockp.ppt
Ch4 threads
4.Threads
Verses: 110 Revealed in: Makkah Main Lesson: Allah’s guidance protects us f...
Chapter 4 Threads used in operating s.ppt
Unit 2-ch4-Threads-CPU- Operating Systems
Unit 2-ch4-Threads concept in Operating systems
chapter 4 introduction to powerpoint .ppt
Threads in the Operating System for OS..
Ad

More from Syaiful Ahdan (20)

PDF
Sertifikat EC00202128391
PDF
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
PDF
Sertifikat ec00202059774
PDF
Sertifikat ec00202059775
PDF
Sertifikat EC00202045078
PDF
Sertifikat EC00202044723
PDF
Sertifikat EC00202023523
PDF
Sertifikat EC00201826309
PDF
Sertifikat EC00202023149
PDF
Sertifikat EC00202022868
PDF
Sertifikat EC00202021343
PDF
Sertifikat EC00202022755
PDF
Sertifikat EC00201987196
PDF
Sertifikat EC00201856484
PDF
Sertifikat EC00201856352
PDF
Sertifikat EC00201856994
PDF
Sertifikat EC00201856895
PDF
Meeting 2 introdcution network administrator
PDF
Pertemuan 5
PDF
Pertemuan 4
Sertifikat EC00202128391
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
Sertifikat ec00202059774
Sertifikat ec00202059775
Sertifikat EC00202045078
Sertifikat EC00202044723
Sertifikat EC00202023523
Sertifikat EC00201826309
Sertifikat EC00202023149
Sertifikat EC00202022868
Sertifikat EC00202021343
Sertifikat EC00202022755
Sertifikat EC00201987196
Sertifikat EC00201856484
Sertifikat EC00201856352
Sertifikat EC00201856994
Sertifikat EC00201856895
Meeting 2 introdcution network administrator
Pertemuan 5
Pertemuan 4

Recently uploaded (20)

PDF
Uderstanding digital marketing and marketing stratergie for engaging the digi...
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PDF
Empowerment Technology for Senior High School Guide
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PDF
International_Financial_Reporting_Standa.pdf
PDF
Race Reva University – Shaping Future Leaders in Artificial Intelligence
PDF
Hazard Identification & Risk Assessment .pdf
PPTX
Education and Perspectives of Education.pptx
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PPTX
Module on health assessment of CHN. pptx
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
PDF
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
PDF
LEARNERS WITH ADDITIONAL NEEDS ProfEd Topic
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
Uderstanding digital marketing and marketing stratergie for engaging the digi...
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
A powerpoint presentation on the Revised K-10 Science Shaping Paper
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Empowerment Technology for Senior High School Guide
Share_Module_2_Power_conflict_and_negotiation.pptx
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
International_Financial_Reporting_Standa.pdf
Race Reva University – Shaping Future Leaders in Artificial Intelligence
Hazard Identification & Risk Assessment .pdf
Education and Perspectives of Education.pptx
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
Paper A Mock Exam 9_ Attempt review.pdf.
Module on health assessment of CHN. pptx
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
LEARNERS WITH ADDITIONAL NEEDS ProfEd Topic
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...

Ch4 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 Chapter 4 : 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 Chapter 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