SlideShare a Scribd company logo
1 of 11
Nadar Saraswathi College Of Arts and
Science,Theni.
Thread Process Synchronization
Submitted by
A. Naga varthini
I.Msc(cs)
What is Thread?
A thread is a flow of execution through the process code, with its own
program counter that keeps track of which instruction to execute next, system
registers which hold its current working variables, and a stack which contain the
execution history.
A thread is also called a lightweight process. Thread provide a way to
improve application performance through parallelism. Thread represent a
software approach to improving performance of operating system by reducing
the overhead thread is equivalent to a classical process.
Each thread represents a separate flow of control. Thread have been successfully
used in implementing network servers and wed server. The following figure shows the
working of a single-threaded and a multithreaded process.
Register Counter Stack
Data Files
Code
Single
Thread
Register
Counter
Stack
Register
Counter
Stack
Register
Counter
Stack
Data Files
First Thread Second Thread Third Thread
Code
Advantages of Thread:
 Thread minimize the context switching time.
 Use of threads provides concurrency within a process.
 Efficient communication.
 It is more economical to create and context switch threads.
 Threads allow utilization of multiprocessor architectures to a greater
scale and efficienty.
Types of Thread:
Thread are implemented in following two ways:
User Level Thread- User managed threads.
Kernel Level Thread- Operating system managed threads acting
on kernel, an operating system core.
User Level Threads:
In this case, the thread management kernel is no aware of the existence
of threads. The thread library contains code for creating and destroying
threads, for passing, message and data between threads, for scheduling thrad
execution and for saving and restoring thread contexts.
Advantages:
 Thread switching does not require kernel mode privileges.
 User level thread can run on any operating system.
 Scheduling can be application specific in the user level thread.
 User level threads area fast to create and manage.
Disadvantage:
 In a typical operating system, most system calls are blocking.
 Multithreaded application cannot take advantage of multiprocessing.
Kernel Level Threads:
Kernel thread are supported directly by the operating system. Any
application can be programmed to be multithreaded. All of the thread within
an application are supported within a single process.
The kernel maintains context information for the process as a whole
and for individual threads within the process. Scheduling by the kernel is done
on a thread basis. The kernel performs thread creation, scheduling and
management in kernel space. Kernel threads are generally slower to create and
manage than the user threads.
Advantages:
 Kernel can simultaneously schedule multiple threads form the same
process on multiple processes.
 If one thread in a process is blocked, the kernel can schedule
another thread of the same process.
Thank you

More Related Content

Similar to dos slide share.pptx

Operating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptxOperating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptxPrudhvi668506
 
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 ..Nimrakhan89
 
Networking threads
Networking threadsNetworking threads
Networking threadsNilesh Pawar
 
Thread (Operating System)
Thread  (Operating System)Thread  (Operating System)
Thread (Operating System)kiran Patel
 
process and thread.pptx
process and thread.pptxprocess and thread.pptx
process and thread.pptxHamzaxTv
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)Prakhar Maurya
 
Operating system 20 threads
Operating system 20 threadsOperating system 20 threads
Operating system 20 threadsVaibhav Khanna
 
Parallel and Distributed Computing chapter 3
Parallel and Distributed Computing chapter 3Parallel and Distributed Computing chapter 3
Parallel and Distributed Computing chapter 3AbdullahMunir32
 

Similar to dos slide share.pptx (20)

Operating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptxOperating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptx
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 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 ..
 
Topic 4- processes.pptx
Topic 4- processes.pptxTopic 4- processes.pptx
Topic 4- processes.pptx
 
Wiki 2
Wiki 2Wiki 2
Wiki 2
 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
 
Sucet os module_2_notes
Sucet os module_2_notesSucet os module_2_notes
Sucet os module_2_notes
 
Networking threads
Networking threadsNetworking threads
Networking threads
 
Threads
ThreadsThreads
Threads
 
Chapter 3 chapter reading task
Chapter 3 chapter reading taskChapter 3 chapter reading task
Chapter 3 chapter reading task
 
Epc 3.ppt
Epc 3.pptEpc 3.ppt
Epc 3.ppt
 
Thread (Operating System)
Thread  (Operating System)Thread  (Operating System)
Thread (Operating System)
 
process and thread.pptx
process and thread.pptxprocess and thread.pptx
process and thread.pptx
 
4.Process.ppt
4.Process.ppt4.Process.ppt
4.Process.ppt
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Assignment-01.pptx
Assignment-01.pptxAssignment-01.pptx
Assignment-01.pptx
 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
 
Operating system 20 threads
Operating system 20 threadsOperating system 20 threads
Operating system 20 threads
 
Chapter04 new
Chapter04 newChapter04 new
Chapter04 new
 
Parallel and Distributed Computing chapter 3
Parallel and Distributed Computing chapter 3Parallel and Distributed Computing chapter 3
Parallel and Distributed Computing chapter 3
 

More from NagaVarthini

Dealing with imbalanced data sets.pdf
Dealing with imbalanced data sets.pdfDealing with imbalanced data sets.pdf
Dealing with imbalanced data sets.pdfNagaVarthini
 
Edge detection.pdf
Edge detection.pdfEdge detection.pdf
Edge detection.pdfNagaVarthini
 
Django Designing.pdf
Django Designing.pdfDjango Designing.pdf
Django Designing.pdfNagaVarthini
 
Cloud Software Enviornment
Cloud Software EnviornmentCloud Software Enviornment
Cloud Software EnviornmentNagaVarthini
 
Guidelines for indexing and tools
Guidelines for indexing and toolsGuidelines for indexing and tools
Guidelines for indexing and toolsNagaVarthini
 
Email established keys privacy
Email established keys privacyEmail established keys privacy
Email established keys privacyNagaVarthini
 
python slid share.pptx
python slid share.pptxpython slid share.pptx
python slid share.pptxNagaVarthini
 

More from NagaVarthini (7)

Dealing with imbalanced data sets.pdf
Dealing with imbalanced data sets.pdfDealing with imbalanced data sets.pdf
Dealing with imbalanced data sets.pdf
 
Edge detection.pdf
Edge detection.pdfEdge detection.pdf
Edge detection.pdf
 
Django Designing.pdf
Django Designing.pdfDjango Designing.pdf
Django Designing.pdf
 
Cloud Software Enviornment
Cloud Software EnviornmentCloud Software Enviornment
Cloud Software Enviornment
 
Guidelines for indexing and tools
Guidelines for indexing and toolsGuidelines for indexing and tools
Guidelines for indexing and tools
 
Email established keys privacy
Email established keys privacyEmail established keys privacy
Email established keys privacy
 
python slid share.pptx
python slid share.pptxpython slid share.pptx
python slid share.pptx
 

Recently uploaded

Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
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
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
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
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
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
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 

Recently uploaded (20)

Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
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
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
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🔝
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
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
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
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
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 

dos slide share.pptx

  • 1. Nadar Saraswathi College Of Arts and Science,Theni. Thread Process Synchronization Submitted by A. Naga varthini I.Msc(cs)
  • 2. What is Thread? A thread is a flow of execution through the process code, with its own program counter that keeps track of which instruction to execute next, system registers which hold its current working variables, and a stack which contain the execution history. A thread is also called a lightweight process. Thread provide a way to improve application performance through parallelism. Thread represent a software approach to improving performance of operating system by reducing the overhead thread is equivalent to a classical process.
  • 3. Each thread represents a separate flow of control. Thread have been successfully used in implementing network servers and wed server. The following figure shows the working of a single-threaded and a multithreaded process. Register Counter Stack Data Files Code Single Thread
  • 5. Advantages of Thread:  Thread minimize the context switching time.  Use of threads provides concurrency within a process.  Efficient communication.  It is more economical to create and context switch threads.  Threads allow utilization of multiprocessor architectures to a greater scale and efficienty.
  • 6. Types of Thread: Thread are implemented in following two ways: User Level Thread- User managed threads. Kernel Level Thread- Operating system managed threads acting on kernel, an operating system core.
  • 7. User Level Threads: In this case, the thread management kernel is no aware of the existence of threads. The thread library contains code for creating and destroying threads, for passing, message and data between threads, for scheduling thrad execution and for saving and restoring thread contexts.
  • 8. Advantages:  Thread switching does not require kernel mode privileges.  User level thread can run on any operating system.  Scheduling can be application specific in the user level thread.  User level threads area fast to create and manage. Disadvantage:  In a typical operating system, most system calls are blocking.  Multithreaded application cannot take advantage of multiprocessing.
  • 9. Kernel Level Threads: Kernel thread are supported directly by the operating system. Any application can be programmed to be multithreaded. All of the thread within an application are supported within a single process. The kernel maintains context information for the process as a whole and for individual threads within the process. Scheduling by the kernel is done on a thread basis. The kernel performs thread creation, scheduling and management in kernel space. Kernel threads are generally slower to create and manage than the user threads.
  • 10. Advantages:  Kernel can simultaneously schedule multiple threads form the same process on multiple processes.  If one thread in a process is blocked, the kernel can schedule another thread of the same process.