SlideShare uma empresa Scribd logo
1 de 31
Process Control Block
Threads & Their Management
By Ujjwal Kumar
1149210055
CS – V – 2013
Process Control
Block
or
PCB
Presentation by Ujjwal
Kumar
2
Introduction
• Each & every process in the Operating System is
represented by a Process Control Block.
• Process Control Block ~ Task Control Block or
Task Struct.
3
Presentation by Ujjwal
Kumar
What exactly is PCB?
• It is a Data Structure in the operating system
kernel containing the information needed to
manage a particular process.
• The PCB is "the manifestation(Visible) of a
process in an operating system”
4
Presentation by Ujjwal
Kumar
Presentation by Ujjwal
Kumar
5
Source: http://lmgtfy.com/?q=define%3Amanifestation/
Presentation by Ujjwal
Kumar
6
Fig: Process Control Block (PCB)
What exactly does this
diagram mean?
Presentation by Ujjwal
Kumar
7
• Pointers: It contains the address of another
process which is present in the ready queue.
• Process State: It contains information about
the state of the process i.e.,
• New
• Ready
• Running
• Waiting
• Halted
Presentation by Ujjwal
Kumar
8
• Program Counter: The address of the next
instruction to be executed.
• CPU Registers: The registers vary in no. and
type depending on the type of computer
architecture, they include:
• Accumulators, index registers, stack pointers and
general purpose registers
Presentation by Ujjwal
Kumar
9
• CPU scheduling information: This
information includes
▫ Process priority
▫ Pointer to scheduling queues
▫ Other scheduling parameters.
• Memory management information: This
information includes
▫ Value of base and limit registers
▫ Page tables
▫ Segment tables.
Presentation by Ujjwal
Kumar
10
• Accounting information: This information
includes
• Amount of CPU and real time used
• Time limits
• Account numbers
• Job or Process numbers etc.
• I/O status information: This information
includes
• List of I/O devices allocated to the process
• List of open files etc .
Presentation by Ujjwal
Kumar
11
Now we know what exactly the
Process Control Block is. But
do we know where the location
of PCB is?
Presentation by Ujjwal
Kumar
12
• Contains critical information of processes and
hence it must be placed where it is protected
from normal user access.
• In many Operating systems, it is placed in the
beginning of the kernel stack of the process since
that is a convenient protected location.
Presentation by Ujjwal
Kumar
13
Interleaving
Execution of
Processes
Presentation by Ujjwal
Kumar
14
Interleaving Execution of Processes
• Perception of normal end user:
Presentation by Ujjwal
Kumar
15
Process
A Process
B
Process
C
Process D
Time
Interleaving Execution of Processes
• In reality, this is how the processes are executed:
Presentation by Ujjwal
Kumar
16
Process 1
Process 2
Process 1
Process 2
Threads &
their Management
Presentation by Ujjwal
Kumar
17
Threads
• Definition: In simple words we can say that
Threads are light weight processes.
• It is a sequence and not a program because it
cannot run on its own so it returns within the
program.
• A process is divided into smaller tasks and these
tasks are known as threads.
• A basic unit of CPU Utilization.
Presentation by Ujjwal
Kumar
18
Advantages of Threads
• If a process has multiple threads then it will be
able to perform more than one single task at the
same time.
• Better Throughput.
• Makes the program Responsive.
Presentation by Ujjwal
Kumar
19
Types of Threading
•Single Threading
•Multi Threading
Presentation by Ujjwal
Kumar
20
Multithreading
• Sometimes several similar tasks have to be
performed by the application in order to get the
word done.
• This is where the Multithreading comes in.
Presentation by Ujjwal
Kumar
21
Real life examples of Multithreading - I
• Web browsers: They have different threads to
do different work.
▫ One thread will retrieve data from the remote
servers.
▫ Another one will render the data received into
visual web pages.
• Example: Google Chrome, Opera, Firefox etc.
Presentation by Ujjwal
Kumar
22
Real life examples of Multithreading -
II
• Word Processors: Different threads in word
processor will do different jobs.
▫ One will render the text based materials.
▫ Another one will render graphic based materials
like the images etc.
• Example: Microsoft Office
Presentation by Ujjwal
Kumar
23
Benefits of Multithreading
• Responsiveness: The process responds much
better while using multithreading as compared
to single threaded processes.
• Speed Up: The process is speeded up by using
multithreading hence giving a much better
experience to the end user.
• Efficient Communication: The threads of a
specific process can communicate with each
other efficiently because of the shared address
space.
Presentation by Ujjwal
Kumar
24
• Utilization in multiprocessor systems:
▫ Multithreading can take advantages of a
multiprocessor system.
▫ Multiple threads can be processed on multiple
cores of the system.
Presentation by Ujjwal
Kumar
25
Implementation of Threads
• Threads are implemented in a system in three
different ways.
▫ Kernel Level Threads
▫ User Level Threads
▫ Hybrid Level Threads
Presentation by Ujjwal
Kumar
26
Kernel Level Threads
• Implemented by the kernel itself.
• Management of threads is also done by the
kernel itself.
Presentation by Ujjwal
Kumar
27
Process
Threads
Process
Table
User Level Thread
Presentation by Ujjwal
Kumar
28
Kernel Space
Thread
Table
Thread
Process
User
Space
User Level Thread
• These type of threads are loaded in the user
space and the kernel doesn’t have anything to do
with this.
• Threads are managed in user space so each
process must have its own private thread table.
• This table consists the information of:
▫ Program Counter
▫ Stack Pointer
▫ Register.
Presentation by Ujjwal
Kumar
29
Acknowledgements
• Sir. Mukesh Kumar Singh
• Google.com
• Book: OS by Vijay Shukla
Presentation by Ujjwal
Kumar
30
Questions
You can ask any questions
you might have in your
mind related to my
presentation.
Presentation by Ujjwal
Kumar
31

Mais conteúdo relacionado

Mais procurados (20)

Process concept
Process conceptProcess concept
Process concept
 
Lecture5
Lecture5Lecture5
Lecture5
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
Process management in os
Process management in osProcess management in os
Process management in os
 
Os presentation process
Os presentation processOs presentation process
Os presentation process
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Basic concept of process
Basic concept of processBasic concept of process
Basic concept of process
 
process control blockPcb
process control blockPcbprocess control blockPcb
process control blockPcb
 
process control block
process control blockprocess control block
process control block
 
OS Chapter03
OS Chapter03OS Chapter03
OS Chapter03
 
My ppt @ bec doms on process management
My ppt @ bec doms on process managementMy ppt @ bec doms on process management
My ppt @ bec doms on process management
 
Process in operating system
Process in operating systemProcess in operating system
Process in operating system
 
Operating System 3
Operating System 3Operating System 3
Operating System 3
 
Processes description and process control.
Processes description and process control.Processes description and process control.
Processes description and process control.
 
Lecture 2 process
Lecture 2   processLecture 2   process
Lecture 2 process
 
Unix Process management
Unix Process managementUnix Process management
Unix Process management
 
Processes and operating systems
Processes and operating systemsProcesses and operating systems
Processes and operating systems
 
Unit 4
Unit  4Unit  4
Unit 4
 
Process management
Process managementProcess management
Process management
 
Process
ProcessProcess
Process
 

Semelhante a Process Control Block & Threads and Their Management

Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentationchnrketan
 
L-2 (Computer Performance).ppt
L-2 (Computer Performance).pptL-2 (Computer Performance).ppt
L-2 (Computer Performance).pptImranKhan997082
 
SOC System Design Approach
SOC System Design ApproachSOC System Design Approach
SOC System Design ApproachA B Shinde
 
System development life cycle (sdlc)
System development life cycle (sdlc)System development life cycle (sdlc)
System development life cycle (sdlc)Mukund Trivedi
 
Unit 1 Computer organization and Instructions
Unit 1 Computer organization and InstructionsUnit 1 Computer organization and Instructions
Unit 1 Computer organization and InstructionsBalaji Vignesh
 
Process Management Operating Systems .pptx
Process Management        Operating Systems .pptxProcess Management        Operating Systems .pptx
Process Management Operating Systems .pptxSAIKRISHNADURVASULA2
 
Unit 2_OS process management
Unit 2_OS process management Unit 2_OS process management
Unit 2_OS process management JayeshGadhave1
 
Software Engineering - Ch12
Software Engineering - Ch12Software Engineering - Ch12
Software Engineering - Ch12Siddharth Ayer
 
MODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptxMODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptxsenthilkumar969017
 
Document 14 (6).pdf
Document 14 (6).pdfDocument 14 (6).pdf
Document 14 (6).pdfRajMantry
 
Task migration using CRIU
Task migration using CRIUTask migration using CRIU
Task migration using CRIURohit Jnagal
 
OPERATING__SYSTEM_PROCESS.pptx
OPERATING__SYSTEM_PROCESS.pptxOPERATING__SYSTEM_PROCESS.pptx
OPERATING__SYSTEM_PROCESS.pptxMarkWambette
 
Basics of micro controllers for biginners
Basics of  micro controllers for biginnersBasics of  micro controllers for biginners
Basics of micro controllers for biginnersGerwin Makanyanga
 
Windows process-scheduling
Windows process-schedulingWindows process-scheduling
Windows process-schedulingTalha Shaikh
 

Semelhante a Process Control Block & Threads and Their Management (20)

Process Management
Process ManagementProcess Management
Process Management
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
L-2 (Computer Performance).ppt
L-2 (Computer Performance).pptL-2 (Computer Performance).ppt
L-2 (Computer Performance).ppt
 
SOC System Design Approach
SOC System Design ApproachSOC System Design Approach
SOC System Design Approach
 
System development life cycle (sdlc)
System development life cycle (sdlc)System development life cycle (sdlc)
System development life cycle (sdlc)
 
Unit 1 Computer organization and Instructions
Unit 1 Computer organization and InstructionsUnit 1 Computer organization and Instructions
Unit 1 Computer organization and Instructions
 
Process Management Operating Systems .pptx
Process Management        Operating Systems .pptxProcess Management        Operating Systems .pptx
Process Management Operating Systems .pptx
 
Unit 2_OS process management
Unit 2_OS process management Unit 2_OS process management
Unit 2_OS process management
 
Os
OsOs
Os
 
Operating system 2 by adi
Operating system 2 by adiOperating system 2 by adi
Operating system 2 by adi
 
Software Engineering - Ch12
Software Engineering - Ch12Software Engineering - Ch12
Software Engineering - Ch12
 
MODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptxMODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptx
 
Document 14 (6).pdf
Document 14 (6).pdfDocument 14 (6).pdf
Document 14 (6).pdf
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
Task migration using CRIU
Task migration using CRIUTask migration using CRIU
Task migration using CRIU
 
OPERATING__SYSTEM_PROCESS.pptx
OPERATING__SYSTEM_PROCESS.pptxOPERATING__SYSTEM_PROCESS.pptx
OPERATING__SYSTEM_PROCESS.pptx
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Basics of micro controllers for biginners
Basics of  micro controllers for biginnersBasics of  micro controllers for biginners
Basics of micro controllers for biginners
 
Windows process-scheduling
Windows process-schedulingWindows process-scheduling
Windows process-scheduling
 
Presentation.pdf
Presentation.pdfPresentation.pdf
Presentation.pdf
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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.pdfUK Journal
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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 productivityPrincipled Technologies
 
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...Enterprise Knowledge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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 WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
[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.pdfhans926745
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
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...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.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
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Process Control Block & Threads and Their Management

  • 1. Process Control Block Threads & Their Management By Ujjwal Kumar 1149210055 CS – V – 2013
  • 3. Introduction • Each & every process in the Operating System is represented by a Process Control Block. • Process Control Block ~ Task Control Block or Task Struct. 3 Presentation by Ujjwal Kumar
  • 4. What exactly is PCB? • It is a Data Structure in the operating system kernel containing the information needed to manage a particular process. • The PCB is "the manifestation(Visible) of a process in an operating system” 4 Presentation by Ujjwal Kumar
  • 5. Presentation by Ujjwal Kumar 5 Source: http://lmgtfy.com/?q=define%3Amanifestation/
  • 6. Presentation by Ujjwal Kumar 6 Fig: Process Control Block (PCB)
  • 7. What exactly does this diagram mean? Presentation by Ujjwal Kumar 7
  • 8. • Pointers: It contains the address of another process which is present in the ready queue. • Process State: It contains information about the state of the process i.e., • New • Ready • Running • Waiting • Halted Presentation by Ujjwal Kumar 8
  • 9. • Program Counter: The address of the next instruction to be executed. • CPU Registers: The registers vary in no. and type depending on the type of computer architecture, they include: • Accumulators, index registers, stack pointers and general purpose registers Presentation by Ujjwal Kumar 9
  • 10. • CPU scheduling information: This information includes ▫ Process priority ▫ Pointer to scheduling queues ▫ Other scheduling parameters. • Memory management information: This information includes ▫ Value of base and limit registers ▫ Page tables ▫ Segment tables. Presentation by Ujjwal Kumar 10
  • 11. • Accounting information: This information includes • Amount of CPU and real time used • Time limits • Account numbers • Job or Process numbers etc. • I/O status information: This information includes • List of I/O devices allocated to the process • List of open files etc . Presentation by Ujjwal Kumar 11
  • 12. Now we know what exactly the Process Control Block is. But do we know where the location of PCB is? Presentation by Ujjwal Kumar 12
  • 13. • Contains critical information of processes and hence it must be placed where it is protected from normal user access. • In many Operating systems, it is placed in the beginning of the kernel stack of the process since that is a convenient protected location. Presentation by Ujjwal Kumar 13
  • 15. Interleaving Execution of Processes • Perception of normal end user: Presentation by Ujjwal Kumar 15 Process A Process B Process C Process D Time
  • 16. Interleaving Execution of Processes • In reality, this is how the processes are executed: Presentation by Ujjwal Kumar 16 Process 1 Process 2 Process 1 Process 2
  • 18. Threads • Definition: In simple words we can say that Threads are light weight processes. • It is a sequence and not a program because it cannot run on its own so it returns within the program. • A process is divided into smaller tasks and these tasks are known as threads. • A basic unit of CPU Utilization. Presentation by Ujjwal Kumar 18
  • 19. Advantages of Threads • If a process has multiple threads then it will be able to perform more than one single task at the same time. • Better Throughput. • Makes the program Responsive. Presentation by Ujjwal Kumar 19
  • 20. Types of Threading •Single Threading •Multi Threading Presentation by Ujjwal Kumar 20
  • 21. Multithreading • Sometimes several similar tasks have to be performed by the application in order to get the word done. • This is where the Multithreading comes in. Presentation by Ujjwal Kumar 21
  • 22. Real life examples of Multithreading - I • Web browsers: They have different threads to do different work. ▫ One thread will retrieve data from the remote servers. ▫ Another one will render the data received into visual web pages. • Example: Google Chrome, Opera, Firefox etc. Presentation by Ujjwal Kumar 22
  • 23. Real life examples of Multithreading - II • Word Processors: Different threads in word processor will do different jobs. ▫ One will render the text based materials. ▫ Another one will render graphic based materials like the images etc. • Example: Microsoft Office Presentation by Ujjwal Kumar 23
  • 24. Benefits of Multithreading • Responsiveness: The process responds much better while using multithreading as compared to single threaded processes. • Speed Up: The process is speeded up by using multithreading hence giving a much better experience to the end user. • Efficient Communication: The threads of a specific process can communicate with each other efficiently because of the shared address space. Presentation by Ujjwal Kumar 24
  • 25. • Utilization in multiprocessor systems: ▫ Multithreading can take advantages of a multiprocessor system. ▫ Multiple threads can be processed on multiple cores of the system. Presentation by Ujjwal Kumar 25
  • 26. Implementation of Threads • Threads are implemented in a system in three different ways. ▫ Kernel Level Threads ▫ User Level Threads ▫ Hybrid Level Threads Presentation by Ujjwal Kumar 26
  • 27. Kernel Level Threads • Implemented by the kernel itself. • Management of threads is also done by the kernel itself. Presentation by Ujjwal Kumar 27 Process Threads Process Table
  • 28. User Level Thread Presentation by Ujjwal Kumar 28 Kernel Space Thread Table Thread Process User Space
  • 29. User Level Thread • These type of threads are loaded in the user space and the kernel doesn’t have anything to do with this. • Threads are managed in user space so each process must have its own private thread table. • This table consists the information of: ▫ Program Counter ▫ Stack Pointer ▫ Register. Presentation by Ujjwal Kumar 29
  • 30. Acknowledgements • Sir. Mukesh Kumar Singh • Google.com • Book: OS by Vijay Shukla Presentation by Ujjwal Kumar 30
  • 31. Questions You can ask any questions you might have in your mind related to my presentation. Presentation by Ujjwal Kumar 31

Notas do Editor

  1. In this we will see how the processes are executed by the PCB. Let us first discuss how a normal end user sees the processes being executed.
  2. The processes are done in order of priority so there is no specific order.
  3. Hybrid level thread is out of syllabus so we will not discuss it.