SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Chapter 4:   Threads
What’s in a process? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Concurrency ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What’s needed? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How could we achieve this? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Can we do better? ,[object Object],[object Object],[object Object],[object Object]
Single-Threaded Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Use of Threads ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],CPU1 CPU2 CPU1 CPU2 Time  CPU1 CPU2
Threads and processes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Single and Multithreaded Processes
Benefits ,[object Object],[object Object],[object Object],[object Object]
Thread Design Space address space thread one thread/process many processes many threads/process many processes one thread/process one process many threads/process one process MS/DOS Java older UNIXes Mach, NT, Chorus, Linux, …
(old) Process address space 0x00000000 0x7FFFFFFF address space code (text segment) static data (data segment) heap (dynamic allocated mem) stack (dynamic allocated mem) PC SP
(new) Address space with threads 0x00000000 0x7FFFFFFF address space code (text segment) static data (data segment) heap (dynamic allocated mem) thread 1 stack PC (T2) SP (T2) thread 2 stack thread 3 stack SP (T1) SP (T3) PC (T1) PC (T3) SP PC
Types of Threads
Thread types ,[object Object],[object Object],[object Object],[object Object]
Multithreading Models ,[object Object],[object Object],[object Object]
Multithreading Models ,[object Object]
Multithreading Models ,[object Object],[object Object]
Two-level Model ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Threads Implementation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Threading Issues
Threading Issues ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Semantics of fork() and exec() ,[object Object]
Thread Cancellation ,[object Object],[object Object],[object Object],[object Object]
Signal Handling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Signal Handling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thread Pools ,[object Object],[object Object],[object Object]
Thread Pools ,[object Object],[object Object],[object Object],[object Object]
Thread Specific Data ,[object Object],[object Object]
Scheduler Activations ,[object Object],[object Object],[object Object],[object Object]
Scheduler Activations ,[object Object],[object Object]
OS Examples
Windows XP Threads ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Linux Threads ,[object Object],[object Object],[object Object]
Conclusion ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Conclusion ,[object Object],[object Object],[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
Nitish Gulati
 
Multithreading models
Multithreading modelsMultithreading models
Multithreading models
anoopkrishna2
 
Multithreading models.ppt
Multithreading models.pptMultithreading models.ppt
Multithreading models.ppt
Luis Goldster
 

Was ist angesagt? (20)

Thread
ThreadThread
Thread
 
Chapter 4 - Threads
Chapter 4 - ThreadsChapter 4 - Threads
Chapter 4 - Threads
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
 
Thread management
Thread management Thread management
Thread management
 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
 
Threads
ThreadsThreads
Threads
 
Operating Systems 1 (7/12) - Threads
Operating Systems 1 (7/12) - ThreadsOperating Systems 1 (7/12) - Threads
Operating Systems 1 (7/12) - Threads
 
Operating system: threads(mulithreading,benefits of threads, types of thread)
Operating system: threads(mulithreading,benefits of threads, types of thread)Operating system: threads(mulithreading,benefits of threads, types of thread)
Operating system: threads(mulithreading,benefits of threads, types of thread)
 
Thread
ThreadThread
Thread
 
Multithreading models
Multithreading modelsMultithreading models
Multithreading models
 
Thread (Operating System)
Thread  (Operating System)Thread  (Operating System)
Thread (Operating System)
 
THREADS of Operating System by Noman Zahid
THREADS of Operating System by Noman Zahid THREADS of Operating System by Noman Zahid
THREADS of Operating System by Noman Zahid
 
Threading
ThreadingThreading
Threading
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
threads and its types ....in operating system ..
threads and its types ....in operating system ..threads and its types ....in operating system ..
threads and its types ....in operating system ..
 
OS - Thread
OS - ThreadOS - Thread
OS - Thread
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
Multithreading models.ppt
Multithreading models.pptMultithreading models.ppt
Multithreading models.ppt
 
multi-threading
multi-threadingmulti-threading
multi-threading
 
Treads
TreadsTreads
Treads
 

Andere mochten auch

Operating System 5
Operating System 5Operating System 5
Operating System 5
tech2click
 
Linux process management
Linux process managementLinux process management
Linux process management
Raghu nath
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
Vaibhav Bajaj
 

Andere mochten auch (15)

OS Process and Thread Concepts
OS Process and Thread ConceptsOS Process and Thread Concepts
OS Process and Thread Concepts
 
Nandan Denim Limited
Nandan Denim LimitedNandan Denim Limited
Nandan Denim Limited
 
Process and Threads in Linux - PPT
Process and Threads in Linux - PPTProcess and Threads in Linux - PPT
Process and Threads in Linux - PPT
 
Operating System 5
Operating System 5Operating System 5
Operating System 5
 
Terry Towel Production
Terry Towel ProductionTerry Towel Production
Terry Towel Production
 
Linux process management
Linux process managementLinux process management
Linux process management
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
Types of Yarn and Spinning
Types of Yarn and SpinningTypes of Yarn and Spinning
Types of Yarn and Spinning
 
Processes and Processors in Distributed Systems
Processes and Processors in Distributed SystemsProcesses and Processors in Distributed Systems
Processes and Processors in Distributed Systems
 
Cotton Crop Presentation
Cotton Crop PresentationCotton Crop Presentation
Cotton Crop Presentation
 
Cotton ppt
Cotton pptCotton ppt
Cotton ppt
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 
Chemistry project PREPARATION OF RAYON FROM FILTER PAPER
Chemistry project PREPARATION OF RAYON FROM FILTER PAPER Chemistry project PREPARATION OF RAYON FROM FILTER PAPER
Chemistry project PREPARATION OF RAYON FROM FILTER PAPER
 
Classification of yarn yarn classification. Textile yarn. Yarn count.
Classification of yarn   yarn classification. Textile yarn. Yarn count. Classification of yarn   yarn classification. Textile yarn. Yarn count.
Classification of yarn yarn classification. Textile yarn. Yarn count.
 

Ähnlich wie Operating System 4

WEEK07operatingsystemdepartmentofsoftwareengineering.pptx
WEEK07operatingsystemdepartmentofsoftwareengineering.pptxWEEK07operatingsystemdepartmentofsoftwareengineering.pptx
WEEK07operatingsystemdepartmentofsoftwareengineering.pptx
babayaga920391
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
bleh23
 
Introto netthreads-090906214344-phpapp01
Introto netthreads-090906214344-phpapp01Introto netthreads-090906214344-phpapp01
Introto netthreads-090906214344-phpapp01
Aravindharamanan S
 
Parallel architecture
Parallel architectureParallel architecture
Parallel architecture
Mr SMAK
 
Slot02 concurrency1
Slot02 concurrency1Slot02 concurrency1
Slot02 concurrency1
Viên Mai
 

Ähnlich wie Operating System 4 (20)

Os
OsOs
Os
 
Topic 4- processes.pptx
Topic 4- processes.pptxTopic 4- processes.pptx
Topic 4- processes.pptx
 
Chapter 6 os
Chapter 6 osChapter 6 os
Chapter 6 os
 
Visual comparison of Unix-like systems & Virtualisation
Visual comparison of Unix-like systems & VirtualisationVisual comparison of Unix-like systems & Virtualisation
Visual comparison of Unix-like systems & Virtualisation
 
CH04.pdf
CH04.pdfCH04.pdf
CH04.pdf
 
Oct2009
Oct2009Oct2009
Oct2009
 
Evolution of the Windows Kernel Architecture, by Dave Probert
Evolution of the Windows Kernel Architecture, by Dave ProbertEvolution of the Windows Kernel Architecture, by Dave Probert
Evolution of the Windows Kernel Architecture, by Dave Probert
 
Chapter04 new
Chapter04 newChapter04 new
Chapter04 new
 
Chorus - Distributed Operating System [ case study ]
Chorus - Distributed Operating System [ case study ]Chorus - Distributed Operating System [ case study ]
Chorus - Distributed Operating System [ case study ]
 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcb
 
WEEK07operatingsystemdepartmentofsoftwareengineering.pptx
WEEK07operatingsystemdepartmentofsoftwareengineering.pptxWEEK07operatingsystemdepartmentofsoftwareengineering.pptx
WEEK07operatingsystemdepartmentofsoftwareengineering.pptx
 
Lecture1
Lecture1Lecture1
Lecture1
 
4.Process.ppt
4.Process.ppt4.Process.ppt
4.Process.ppt
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
 
Introto netthreads-090906214344-phpapp01
Introto netthreads-090906214344-phpapp01Introto netthreads-090906214344-phpapp01
Introto netthreads-090906214344-phpapp01
 
Parallel architecture
Parallel architectureParallel architecture
Parallel architecture
 
Slot02 concurrency1
Slot02 concurrency1Slot02 concurrency1
Slot02 concurrency1
 
Parallel Processing (Part 2)
Parallel Processing (Part 2)Parallel Processing (Part 2)
Parallel Processing (Part 2)
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
 
2337610
23376102337610
2337610
 

Mehr von tech2click (12)

Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
 
Ch13
Ch13Ch13
Ch13
 
Ch12
Ch12Ch12
Ch12
 
Ch11
Ch11Ch11
Ch11
 
Ch10
Ch10Ch10
Ch10
 
Ch8
Ch8Ch8
Ch8
 
Tutorial4 Threads
Tutorial4  ThreadsTutorial4  Threads
Tutorial4 Threads
 
Mid1 Revision
Mid1  RevisionMid1  Revision
Mid1 Revision
 
Operating System 3
Operating System 3Operating System 3
Operating System 3
 
Tutorial 2
Tutorial 2Tutorial 2
Tutorial 2
 
Operating System 2
Operating System 2Operating System 2
Operating System 2
 
Rootkit
RootkitRootkit
Rootkit
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Operating System 4

  • 1. Chapter 4: Threads
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 11.
  • 12. Thread Design Space address space thread one thread/process many processes many threads/process many processes one thread/process one process many threads/process one process MS/DOS Java older UNIXes Mach, NT, Chorus, Linux, …
  • 13. (old) Process address space 0x00000000 0x7FFFFFFF address space code (text segment) static data (data segment) heap (dynamic allocated mem) stack (dynamic allocated mem) PC SP
  • 14. (new) Address space with threads 0x00000000 0x7FFFFFFF address space code (text segment) static data (data segment) heap (dynamic allocated mem) thread 1 stack PC (T2) SP (T2) thread 2 stack thread 3 stack SP (T1) SP (T3) PC (T1) PC (T3) SP PC
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 34.
  • 35.
  • 36.
  • 37.