SlideShare a Scribd company logo
1 of 16
PARALLEL & DISTRIBUTED
COMPUTING
Threads
• Thread is often referred to as a light weight
process. The process can be split down into
so many threads. For example, in a browser,
many tabs can be viewed as threads. It is a
basic unit of CPU utilization; it comprises a
thread ID, a program counter, a register set,
and a stack.
• In busy WWW server: The server creates a
separate thread that would listen for clients
requests, when a request was made, creates
a thread to service the request.
os5 2
Single and Multithreaded Processes
os5 3
Multiple threads within a task
program
counter
task
code segment
data segment
threads
Benefits
• Responsiveness: Allow a program to continue running
even if part of it is blocked or is performing a lengthy
operation.
• Resource sharing: several different threads of activity
all within the same address space.
• Economy: Allocating memory and resources for
process creation is costly.
• Utilization of multiprocessor architecture: Several
thread may be running in parallel on different
processors.
Types Of Threads
USER THREAD KERNEL THREAD
User Level Threads are simple and quick to create
and Can run on any operating system. Thread
management done by user-level threads library.
Kernel Thread is a thread that only runs
in kernel mode and has no user address space and
Kernel threads are supported directly by operating
system
Multithreading Models
Multi-Thread vs. Multi-process
Multiple process
Each is independent and has it own program counter,
stack register, and address space. This is useful for
unrelated jobs.
Multiple processes can perform the same task as well. E.g.,
provide data to remote machines in a network file system).
Each executes the same code but has it own memory and
file resources.
A multiple-thread process
It is more efficient to have one process containing multiple
threads serve the same task.
Most Systems Support for both user and kernel threads
Multithreading Models
• Many-to-One
• One-to-One
• Many-to-Many
Many-to-One
• Many user-level threads mapped to single
kernel thread.
• Used on systems that do not support kernel
threads.
Thread management is done in user space, so it is
efficient.
The entire process will block if a thread makes a
blocking system call.
Only one thread can access the kernel at a time,
multiple threads are unable to run in parallel on
multiprocessors.
Many-to-One Model
One-to-One
• Each user-level thread maps to kernel thread.
More concurrency
Overhead: Creating a thread requires creating
the corresponding kernel thread.
• Examples
- Windows 95/98/2000
One-to-one Model
Many-to-Many
• Multiplexes many user-level threads to a
smaller or equal number of kernel threads
• Allows the developer to create as many user
threads as wished.
The corresponding kernel threads can run in parallel on
a multiprocessor.
When a thread performs a blocking call, the kernel can
schedule another thread for execution.
• Solaris 2, IRIX, Digital UNIX.
• Windows NT/2000 with the Thread Fiber
package
Many-to-Many Model

More Related Content

Similar to W-9.pptx

Similar to W-9.pptx (20)

Thread (Operating System)
Thread  (Operating System)Thread  (Operating System)
Thread (Operating System)
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
Treads
TreadsTreads
Treads
 
15 threads
15 threads15 threads
15 threads
 
Java Thread & Multithreading
Java Thread & MultithreadingJava Thread & Multithreading
Java Thread & Multithreading
 
Thread
ThreadThread
Thread
 
Ch04 threads
Ch04 threadsCh04 threads
Ch04 threads
 
Topic 4- processes.pptx
Topic 4- processes.pptxTopic 4- processes.pptx
Topic 4- processes.pptx
 
Multi threading models
Multi threading modelsMulti threading models
Multi threading models
 
Pthread
PthreadPthread
Pthread
 
Thread
ThreadThread
Thread
 
Epc 3.ppt
Epc 3.pptEpc 3.ppt
Epc 3.ppt
 
Wiki 2
Wiki 2Wiki 2
Wiki 2
 
Processes and Threads in Windows Vista
Processes and Threads in Windows VistaProcesses and Threads in Windows Vista
Processes and Threads in Windows Vista
 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
 
Assignment-01.pptx
Assignment-01.pptxAssignment-01.pptx
Assignment-01.pptx
 
Concept of thread
Concept of threadConcept of thread
Concept of thread
 
Thread
ThreadThread
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)
Operating system: threads(mulithreading,benefits of threads, types of thread)
 
Multithreading
Multithreading Multithreading
Multithreading
 

Recently uploaded

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
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
 
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
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
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
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
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
 
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
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
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🔝
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
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 🔝✔️✔️
 
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
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
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
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
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
 
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
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

W-9.pptx

  • 2. Threads • Thread is often referred to as a light weight process. The process can be split down into so many threads. For example, in a browser, many tabs can be viewed as threads. It is a basic unit of CPU utilization; it comprises a thread ID, a program counter, a register set, and a stack. • In busy WWW server: The server creates a separate thread that would listen for clients requests, when a request was made, creates a thread to service the request. os5 2
  • 3. Single and Multithreaded Processes os5 3
  • 4. Multiple threads within a task program counter task code segment data segment threads
  • 5. Benefits • Responsiveness: Allow a program to continue running even if part of it is blocked or is performing a lengthy operation. • Resource sharing: several different threads of activity all within the same address space. • Economy: Allocating memory and resources for process creation is costly. • Utilization of multiprocessor architecture: Several thread may be running in parallel on different processors.
  • 6. Types Of Threads USER THREAD KERNEL THREAD User Level Threads are simple and quick to create and Can run on any operating system. Thread management done by user-level threads library. Kernel Thread is a thread that only runs in kernel mode and has no user address space and Kernel threads are supported directly by operating system
  • 7.
  • 8.
  • 9. Multithreading Models Multi-Thread vs. Multi-process Multiple process Each is independent and has it own program counter, stack register, and address space. This is useful for unrelated jobs. Multiple processes can perform the same task as well. E.g., provide data to remote machines in a network file system). Each executes the same code but has it own memory and file resources. A multiple-thread process It is more efficient to have one process containing multiple threads serve the same task. Most Systems Support for both user and kernel threads
  • 10. Multithreading Models • Many-to-One • One-to-One • Many-to-Many
  • 11. Many-to-One • Many user-level threads mapped to single kernel thread. • Used on systems that do not support kernel threads. Thread management is done in user space, so it is efficient. The entire process will block if a thread makes a blocking system call. Only one thread can access the kernel at a time, multiple threads are unable to run in parallel on multiprocessors.
  • 13. One-to-One • Each user-level thread maps to kernel thread. More concurrency Overhead: Creating a thread requires creating the corresponding kernel thread. • Examples - Windows 95/98/2000
  • 15. Many-to-Many • Multiplexes many user-level threads to a smaller or equal number of kernel threads • Allows the developer to create as many user threads as wished. The corresponding kernel threads can run in parallel on a multiprocessor. When a thread performs a blocking call, the kernel can schedule another thread for execution. • Solaris 2, IRIX, Digital UNIX. • Windows NT/2000 with the Thread Fiber package