SlideShare una empresa de Scribd logo
1 de 13
adeel_tc@hotmail.com 0315-4632432   1
adeel_tc@hotmail.com 0315-4632432   2
 process:
 •    an address space with 1 or more threads
     executing within that address space, and the
     required system resources for those threads
 •   a program that is running
 thread:
 •   a sequence of control within a process
 •   shares the resources in that process




          adeel_tc@hotmail.com 0315-4632432    3
THREADS




  adeel_tc@hotmail.com 0315-4632432   4
 Advantages:
 •   the overhead for creating a thread is significantly
     less than that for creating a process
 •   multitasking, i.e., one process serves multiple
     clients
 •   switching between threads requires the OS to do
     much less work than switching between
     processes




           adeel_tc@hotmail.com 0315-4632432     5
 Drawbacks:


 • not as widely available as longer established
   features
 • writing multithreaded programs require more
   careful thought
 • more difficult to debug than single threaded
   programs
 • for single processor machines, creating several
   threads in a program may not necessarily produce
   an increase in performance (only so many CPU
   cycles to be had)



      adeel_tc@hotmail.com 0315-4632432   6
THREADS
   Thread management done by user-level threads library

   Examples
    - POSIX Pthreads
    - Mach C-threads
    - Solaris threads

• Supported by the Kernel

• Examples
  - Windows 95/98/NT/2000
  - Solaris
  - Tru64 UNIX
  - BeOS
  - Linux
              adeel_tc@hotmail.com 0315-4632432       7
THREADS

 Many-to-One


 One-to-One


 Many-to-Many




       adeel_tc@hotmail.com 0315-4632432   8
THREADS

   Many user-level threads
    mapped to single kernel
    thread.

   Used on systems that do
    not support kernel
    threads.
   Examples:
    Solaris Green Threads
    GNU Portable Threads




              adeel_tc@hotmail.com 0315-4632432   9
THREADS
   Each user-level thread maps to kernel thread.

   Examples
    - Windows 95/98/NT/2000
    - Linux




              adeel_tc@hotmail.com 0315-4632432     10
 In this model, the library has two
  kinds of threads: bound and
  unbound
   bound threads are mapped each
    to a single lightweight process
   unbound threads may be
    mapped to the same LWP
 Probably the best of both worlds
 Used in the Solaris
  implementation of Pthreads (and
  several other Unix
  implementations)


            adeel_tc@hotmail.com 0315-4632432   11
adeel_tc@hotmail.com 0315-4632432   12
adeel_tc@hotmail.com 0315-4632432

Más contenido relacionado

La actualidad más candente

Process management in os
Process management in osProcess management in os
Process management in os
Miong Lazaro
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
Nitish Gulati
 

La actualidad más candente (20)

Introduction to Network and System Administration
Introduction to Network and System AdministrationIntroduction to Network and System Administration
Introduction to Network and System Administration
 
Memory management
Memory managementMemory management
Memory management
 
System call
System callSystem call
System call
 
Demand paging
Demand pagingDemand paging
Demand paging
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Process management in os
Process management in osProcess management in os
Process management in os
 
Distributed Operating Systems
Distributed Operating SystemsDistributed Operating Systems
Distributed Operating Systems
 
chapter 1 intoduction to operating system
chapter 1 intoduction to operating systemchapter 1 intoduction to operating system
chapter 1 intoduction to operating system
 
OPERATING SYSTEMS DESIGN AND IMPLEMENTATION
OPERATING SYSTEMSDESIGN AND IMPLEMENTATIONOPERATING SYSTEMSDESIGN AND IMPLEMENTATION
OPERATING SYSTEMS DESIGN AND IMPLEMENTATION
 
CS6401 OPERATING SYSTEMS Unit 2
CS6401 OPERATING SYSTEMS Unit 2CS6401 OPERATING SYSTEMS Unit 2
CS6401 OPERATING SYSTEMS Unit 2
 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
 
Deadlock
DeadlockDeadlock
Deadlock
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
 

Destacado

Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
Sonali Chauhan
 
Android service, aidl - day 1
Android service, aidl - day 1Android service, aidl - day 1
Android service, aidl - day 1
Utkarsh Mankad
 
Lecture Slides for Preferences and Menus [Android ]
Lecture Slides for Preferences and Menus [Android ]Lecture Slides for Preferences and Menus [Android ]
Lecture Slides for Preferences and Menus [Android ]
Nehil Jain
 
Process Synchronization
Process SynchronizationProcess Synchronization
Process Synchronization
Sonali Chauhan
 
Android intents, notification and broadcast recievers
Android intents, notification and broadcast recieversAndroid intents, notification and broadcast recievers
Android intents, notification and broadcast recievers
Utkarsh Mankad
 
Android - Thread, Handler and AsyncTask
Android - Thread, Handler and AsyncTaskAndroid - Thread, Handler and AsyncTask
Android - Thread, Handler and AsyncTask
Hoang Ngo
 

Destacado (20)

Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
 
Operating Systems 1 (7/12) - Threads
Operating Systems 1 (7/12) - ThreadsOperating Systems 1 (7/12) - Threads
Operating Systems 1 (7/12) - Threads
 
Android App Development - 07 Threading
Android App Development - 07 ThreadingAndroid App Development - 07 Threading
Android App Development - 07 Threading
 
Android async task
Android async taskAndroid async task
Android async task
 
Android Dialogs Tutorial
Android Dialogs TutorialAndroid Dialogs Tutorial
Android Dialogs Tutorial
 
Android service, aidl - day 1
Android service, aidl - day 1Android service, aidl - day 1
Android service, aidl - day 1
 
Deep dive into android restoration - DroidCon Paris 2014
Deep dive into android restoration - DroidCon Paris 2014Deep dive into android restoration - DroidCon Paris 2014
Deep dive into android restoration - DroidCon Paris 2014
 
Lecture Slides for Preferences and Menus [Android ]
Lecture Slides for Preferences and Menus [Android ]Lecture Slides for Preferences and Menus [Android ]
Lecture Slides for Preferences and Menus [Android ]
 
Android service
Android serviceAndroid service
Android service
 
Android Threading
Android ThreadingAndroid Threading
Android Threading
 
Process Synchronization
Process SynchronizationProcess Synchronization
Process Synchronization
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
Android intents, notification and broadcast recievers
Android intents, notification and broadcast recieversAndroid intents, notification and broadcast recievers
Android intents, notification and broadcast recievers
 
Android - Thread, Handler and AsyncTask
Android - Thread, Handler and AsyncTaskAndroid - Thread, Handler and AsyncTask
Android - Thread, Handler and AsyncTask
 
Android Operating System
Android Operating System Android Operating System
Android Operating System
 
Android intents
Android intentsAndroid intents
Android intents
 
Efficient Android Threading
Efficient Android ThreadingEfficient Android Threading
Efficient Android Threading
 
Virtual machine
Virtual machineVirtual machine
Virtual machine
 
Android - Intents - Mazenet Solution
Android - Intents - Mazenet SolutionAndroid - Intents - Mazenet Solution
Android - Intents - Mazenet Solution
 
File Management
File ManagementFile Management
File Management
 

Similar a Thread management

OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
bleh23
 
Multithreading models
Multithreading modelsMultithreading models
Multithreading models
anoopkrishna2
 
Processes and Threads in Windows Vista
Processes and Threads in Windows VistaProcesses and Threads in Windows Vista
Processes and Threads in Windows Vista
Trinh Phuc Tho
 

Similar a Thread management (20)

Ch04 threads
Ch04 threadsCh04 threads
Ch04 threads
 
Threads.ppt
Threads.pptThreads.ppt
Threads.ppt
 
Ch4 threads
Ch4   threadsCh4   threads
Ch4 threads
 
W-9.pptx
W-9.pptxW-9.pptx
W-9.pptx
 
Topic 4- processes.pptx
Topic 4- processes.pptxTopic 4- processes.pptx
Topic 4- processes.pptx
 
Pthread
PthreadPthread
Pthread
 
Operating system 21 multithreading models
Operating system 21 multithreading modelsOperating system 21 multithreading models
Operating system 21 multithreading models
 
Lecture 3- Threads (1).pptx
Lecture 3- Threads (1).pptxLecture 3- Threads (1).pptx
Lecture 3- Threads (1).pptx
 
Operating system 20 threads
Operating system 20 threadsOperating system 20 threads
Operating system 20 threads
 
Clustering
ClusteringClustering
Clustering
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
 
Multithreaded Programming Part- II.pdf
Multithreaded Programming Part- II.pdfMultithreaded Programming Part- II.pdf
Multithreaded Programming Part- II.pdf
 
4 threads
4 threads4 threads
4 threads
 
Multithreading models
Multithreading modelsMultithreading models
Multithreading models
 
Processes and Threads in Windows Vista
Processes and Threads in Windows VistaProcesses and Threads in Windows Vista
Processes and Threads in Windows Vista
 
15 threads
15 threads15 threads
15 threads
 
Threads
ThreadsThreads
Threads
 
Os
OsOs
Os
 
Lecture 3- Threads.pdf
Lecture 3- Threads.pdfLecture 3- Threads.pdf
Lecture 3- Threads.pdf
 
Multithreaded Programming Part- I.pdf
Multithreaded Programming Part- I.pdfMultithreaded Programming Part- I.pdf
Multithreaded Programming Part- I.pdf
 

Último

Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
JIT KUMAR GUPTA
 
一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理
cyebo
 
Heuristic Evaluation of System & Application
Heuristic Evaluation of System & ApplicationHeuristic Evaluation of System & Application
Heuristic Evaluation of System & Application
Jaime Brown
 
一比一原版格林威治大学毕业证成绩单如何办理
一比一原版格林威治大学毕业证成绩单如何办理一比一原版格林威治大学毕业证成绩单如何办理
一比一原版格林威治大学毕业证成绩单如何办理
cyebo
 
Presentation on 3D Printing.pptx presentation
Presentation on 3D Printing.pptx presentationPresentation on 3D Printing.pptx presentation
Presentation on 3D Printing.pptx presentation
ajroy0196
 

Último (20)

Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...Knowing, Understanding and Planning Cities- Role and Relevance  Physical Plan...
Knowing, Understanding and Planning Cities- Role and Relevance Physical Plan...
 
Claire's designing portfolio presentation
Claire's designing portfolio presentationClaire's designing portfolio presentation
Claire's designing portfolio presentation
 
FW25-26 Fashion Key Items Trend Book Peclers Paris
FW25-26 Fashion Key Items Trend Book Peclers ParisFW25-26 Fashion Key Items Trend Book Peclers Paris
FW25-26 Fashion Key Items Trend Book Peclers Paris
 
BIT Khushi gandhi project.pdf graphic design
BIT Khushi gandhi project.pdf graphic designBIT Khushi gandhi project.pdf graphic design
BIT Khushi gandhi project.pdf graphic design
 
一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理一比一原版谢菲尔德大学毕业证成绩单如何办理
一比一原版谢菲尔德大学毕业证成绩单如何办理
 
spColumn-Manual design column by spcolumn software.pdf
spColumn-Manual design column by spcolumn software.pdfspColumn-Manual design column by spcolumn software.pdf
spColumn-Manual design column by spcolumn software.pdf
 
Eric Parein CV. Parein in English is best pronounced as PARE-IN
Eric Parein CV. Parein in English is best pronounced as PARE-INEric Parein CV. Parein in English is best pronounced as PARE-IN
Eric Parein CV. Parein in English is best pronounced as PARE-IN
 
Heuristic Evaluation of System & Application
Heuristic Evaluation of System & ApplicationHeuristic Evaluation of System & Application
Heuristic Evaluation of System & Application
 
iF_Design_Trend_Report_twentytwenrythree
iF_Design_Trend_Report_twentytwenrythreeiF_Design_Trend_Report_twentytwenrythree
iF_Design_Trend_Report_twentytwenrythree
 
Abdulaziz Tariq Abdulaziz Mustafa CV 2024
Abdulaziz Tariq Abdulaziz Mustafa CV 2024Abdulaziz Tariq Abdulaziz Mustafa CV 2024
Abdulaziz Tariq Abdulaziz Mustafa CV 2024
 
Spring 2024 wkrm_Enhancing Campus Mobility.pdf
Spring 2024 wkrm_Enhancing Campus Mobility.pdfSpring 2024 wkrm_Enhancing Campus Mobility.pdf
Spring 2024 wkrm_Enhancing Campus Mobility.pdf
 
Design lessons from Singapore | Volume 3
Design lessons from Singapore | Volume 3Design lessons from Singapore | Volume 3
Design lessons from Singapore | Volume 3
 
Dos And Dont's Of Logo Design For 2024..
Dos And Dont's Of Logo Design For 2024..Dos And Dont's Of Logo Design For 2024..
Dos And Dont's Of Logo Design For 2024..
 
Bit Dhrumi shah Graphic Designer portfolio
Bit Dhrumi shah Graphic Designer portfolioBit Dhrumi shah Graphic Designer portfolio
Bit Dhrumi shah Graphic Designer portfolio
 
Recycled Modular Low Cost Construction .pdf
Recycled Modular Low Cost Construction .pdfRecycled Modular Low Cost Construction .pdf
Recycled Modular Low Cost Construction .pdf
 
Redefining Globalization, urbanisation and Localisation
Redefining Globalization, urbanisation and LocalisationRedefining Globalization, urbanisation and Localisation
Redefining Globalization, urbanisation and Localisation
 
Week of Action 2022_EIT Climate-KIC_Headers
Week of Action 2022_EIT Climate-KIC_HeadersWeek of Action 2022_EIT Climate-KIC_Headers
Week of Action 2022_EIT Climate-KIC_Headers
 
The Impact of Artificial Intelligence on Modern Healthcare.pptx
The Impact of Artificial Intelligence on Modern Healthcare.pptxThe Impact of Artificial Intelligence on Modern Healthcare.pptx
The Impact of Artificial Intelligence on Modern Healthcare.pptx
 
一比一原版格林威治大学毕业证成绩单如何办理
一比一原版格林威治大学毕业证成绩单如何办理一比一原版格林威治大学毕业证成绩单如何办理
一比一原版格林威治大学毕业证成绩单如何办理
 
Presentation on 3D Printing.pptx presentation
Presentation on 3D Printing.pptx presentationPresentation on 3D Printing.pptx presentation
Presentation on 3D Printing.pptx presentation
 

Thread management

  • 3.  process: • an address space with 1 or more threads executing within that address space, and the required system resources for those threads • a program that is running  thread: • a sequence of control within a process • shares the resources in that process adeel_tc@hotmail.com 0315-4632432 3
  • 5.  Advantages: • the overhead for creating a thread is significantly less than that for creating a process • multitasking, i.e., one process serves multiple clients • switching between threads requires the OS to do much less work than switching between processes adeel_tc@hotmail.com 0315-4632432 5
  • 6.  Drawbacks: • not as widely available as longer established features • writing multithreaded programs require more careful thought • more difficult to debug than single threaded programs • for single processor machines, creating several threads in a program may not necessarily produce an increase in performance (only so many CPU cycles to be had) adeel_tc@hotmail.com 0315-4632432 6
  • 7. THREADS  Thread management done by user-level threads library  Examples - POSIX Pthreads - Mach C-threads - Solaris threads • Supported by the Kernel • Examples - Windows 95/98/NT/2000 - Solaris - Tru64 UNIX - BeOS - Linux adeel_tc@hotmail.com 0315-4632432 7
  • 8. THREADS  Many-to-One  One-to-One  Many-to-Many adeel_tc@hotmail.com 0315-4632432 8
  • 9. THREADS  Many user-level threads mapped to single kernel thread.  Used on systems that do not support kernel threads.  Examples: Solaris Green Threads GNU Portable Threads adeel_tc@hotmail.com 0315-4632432 9
  • 10. THREADS  Each user-level thread maps to kernel thread.  Examples - Windows 95/98/NT/2000 - Linux adeel_tc@hotmail.com 0315-4632432 10
  • 11.  In this model, the library has two kinds of threads: bound and unbound  bound threads are mapped each to a single lightweight process  unbound threads may be mapped to the same LWP  Probably the best of both worlds  Used in the Solaris implementation of Pthreads (and several other Unix implementations) adeel_tc@hotmail.com 0315-4632432 11