SlideShare a Scribd company logo
Multithreading
When there are more than one thread is known as multithreading. A process can have multiple
threads means multiple tasks can be performed at the same time. A word processor may have a
thread for displaying graphics, another thread for responding to keystrokes from the user, and a
third thread for performing spelling and grammar checking in the background.
The operating system in which the multithreading is used
 Windows NT 4.0
 Windows 95
 Windows 98
 Windows 2000
Advantages of Multithreading
Responsiveness. Multithreading an interactive application may allow a program to continue
running even if part of it is blocked or is performing a lengthy operation, thereby increasing
responsiveness to the user.
Resource sharing. Threads share the memory and the resources of the process to which they
belong by default.
Economy. Allocating memory and resources for process creation is costly. Because threads share
the resources of the process to which they belong, it is more economical to create and context-
switch threads.
Scalability. The benefits of multithreading can be even greater in a multiprocessor architecture,
where threads may be running in parallel on different processing cores.
Multithreading Models
Many-to-One Model
The many-to-one model (Figure 4.5) maps many user-level threads to one kernel thread. Thread
management is done by the thread library in user space, so it is efficient (we discuss thread libraries
in Section 4.4). However, the entire process will block if a thread makes a blocking system call.
Also, because only one thread can access the kernel at a time, multiple threads are unable to run.
Solaris systems and adopted in early versions of Java—used the many-to-one model.
One-to-One Model
The one-to-one model (Figure 4.6) maps each user thread to a kernel thread. It provides more
concurrency than the many-to-one model by allowing another thread to run when a thread makes
a blocking system call. It also allows multiple threads to run in parallel on multiprocessors. The
only drawback to this model is that creating a user thread requires creating the corresponding
kernel thread.
Many-to-Many Model
The many-to-many model (Figure 4.7) multiplexes many user-level threads to a smaller or equal
number of kernel threads. Let’s consider the effect of this design on concurrency. Whereas the
many-to- one model allows the developer to create as many user threads as she wishes, it does not
result in true concurrency, because the kernel can schedule only one thread at a time. The one-to-
one model allows greater concurrency, but the developer has to be careful not to create too many
threads within an application
The many-to-many model suffers from neither of these shortcomings: developers can create as
many user threads as necessary, and the corresponding kernel threads can run in parallel on a
multiprocessor. Also, when a thread performs a blocking system call, the kernel can schedule
another thread for execution.

More Related Content

PPT
Multi threading models(operating systems)
PPTX
Multithreading models.ppt
PPT
Computer Architecture: A quantitative approach - Cap4 - Section 3
PPTX
Multi threading model
PPT
Computer Architecture: A quantitative approach - Cap4 - Section 1
PPTX
Operating system: threads(mulithreading,benefits of threads, types of thread)
PPT
Multi threading models(operating systems)
Multithreading models.ppt
Computer Architecture: A quantitative approach - Cap4 - Section 3
Multi threading model
Computer Architecture: A quantitative approach - Cap4 - Section 1
Operating system: threads(mulithreading,benefits of threads, types of thread)

What's hot (20)

PPTX
Threads .ppt
PPTX
Mulitthread
PPTX
Threads
PPT
Multithreading models
PDF
Thread
PPTX
Networking threads
PPT
Operating System 4
PPTX
Threads ppt
PPTX
Thread management
PPT
Computer Architecture: A quantitative approach - Cap4 - Section 5
PPT
Operating System-Threads-Galvin
PPTX
PPTX
PPT
Os Threads
PPTX
Thread (Operating System)
PPTX
Multithreading
PDF
4 threads
PPTX
Threads (operating System)
PPT
Ch4 Threads
Threads .ppt
Mulitthread
Threads
Multithreading models
Thread
Networking threads
Operating System 4
Threads ppt
Thread management
Computer Architecture: A quantitative approach - Cap4 - Section 5
Operating System-Threads-Galvin
Os Threads
Thread (Operating System)
Multithreading
4 threads
Threads (operating System)
Ch4 Threads
Ad

Similar to Multithreading (20)

PPTX
Multi threading models
PDF
Basic Threads in Advanced operating system
PPT
15 threads
PPTX
Multi threaded programming
PPTX
PPT
Threads.ppt
PPTX
W-9.pptx
PPT
Operating Systems - "Chapter 4: Multithreaded Programming"
PPT
OS-operating systems- ch04 (Threads) ...
DOC
Wiki 2
PDF
Threads lecture slides for operating systems
PDF
Multithreaded Programming Part- II.pdf
PDF
Multithreaded Programming in oprating system
PPT
Ch5 OS
 
PPTX
Operating system 20 threads
PPTX
Lecture 3 threads
PDF
Section04 threads
PPT
multi-threading
PPT
Multithreading
 
PPT
multithreading
Multi threading models
Basic Threads in Advanced operating system
15 threads
Multi threaded programming
Threads.ppt
W-9.pptx
Operating Systems - "Chapter 4: Multithreaded Programming"
OS-operating systems- ch04 (Threads) ...
Wiki 2
Threads lecture slides for operating systems
Multithreaded Programming Part- II.pdf
Multithreaded Programming in oprating system
Ch5 OS
 
Operating system 20 threads
Lecture 3 threads
Section04 threads
multi-threading
Multithreading
 
multithreading
Ad

More from A. S. M. Shafi (20)

DOCX
Data Warehouse Schema (Star, Snowflake).docx
PDF
Correlation Analysis in Machine Learning.pdf
PDF
Naive Bayes and Decision Tree Algorithm.pdf
PDF
Frequent Pattern Growth Mining Algorithm.pdf
PDF
Direct Hashing and Pruning Algorithm in Data MIning.pdf
PDF
Association Rule Mining with Apriori Algorithm.pdf
PDF
HITS Algorithm in Data and Web MIning.pdf
PDF
Page Rank Algorithm in Data Mining and Web Application.pdf
PDF
K Nearest Neighbor Classifier in Machine Learning.pdf
PDF
K Means Clustering Algorithm in Machine Learning.pdf
PDF
2D Transformation in Computer Graphics
PDF
3D Transformation in Computer Graphics
PDF
Projection
PDF
2D Transformation
PDF
Line drawing algorithm
PDF
Fragmentation
PDF
File organization
PDF
Bankers algorithm
PDF
RR and priority scheduling
PDF
Fcfs and sjf
Data Warehouse Schema (Star, Snowflake).docx
Correlation Analysis in Machine Learning.pdf
Naive Bayes and Decision Tree Algorithm.pdf
Frequent Pattern Growth Mining Algorithm.pdf
Direct Hashing and Pruning Algorithm in Data MIning.pdf
Association Rule Mining with Apriori Algorithm.pdf
HITS Algorithm in Data and Web MIning.pdf
Page Rank Algorithm in Data Mining and Web Application.pdf
K Nearest Neighbor Classifier in Machine Learning.pdf
K Means Clustering Algorithm in Machine Learning.pdf
2D Transformation in Computer Graphics
3D Transformation in Computer Graphics
Projection
2D Transformation
Line drawing algorithm
Fragmentation
File organization
Bankers algorithm
RR and priority scheduling
Fcfs and sjf

Recently uploaded (20)

PDF
01-Introduction-to-Information-Management.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Pharma ospi slides which help in ospi learning
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Institutional Correction lecture only . . .
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Classroom Observation Tools for Teachers
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Supply Chain Operations Speaking Notes -ICLT Program
01-Introduction-to-Information-Management.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Microbial disease of the cardiovascular and lymphatic systems
PPH.pptx obstetrics and gynecology in nursing
Basic Mud Logging Guide for educational purpose
Pharma ospi slides which help in ospi learning
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Institutional Correction lecture only . . .
Anesthesia in Laparoscopic Surgery in India
O5-L3 Freight Transport Ops (International) V1.pdf
Microbial diseases, their pathogenesis and prophylaxis
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Classroom Observation Tools for Teachers
STATICS OF THE RIGID BODIES Hibbelers.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
GDM (1) (1).pptx small presentation for students
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Supply Chain Operations Speaking Notes -ICLT Program

Multithreading

  • 1. Multithreading When there are more than one thread is known as multithreading. A process can have multiple threads means multiple tasks can be performed at the same time. A word processor may have a thread for displaying graphics, another thread for responding to keystrokes from the user, and a third thread for performing spelling and grammar checking in the background. The operating system in which the multithreading is used  Windows NT 4.0  Windows 95  Windows 98  Windows 2000 Advantages of Multithreading Responsiveness. Multithreading an interactive application may allow a program to continue running even if part of it is blocked or is performing a lengthy operation, thereby increasing responsiveness to the user. Resource sharing. Threads share the memory and the resources of the process to which they belong by default. Economy. Allocating memory and resources for process creation is costly. Because threads share the resources of the process to which they belong, it is more economical to create and context- switch threads. Scalability. The benefits of multithreading can be even greater in a multiprocessor architecture, where threads may be running in parallel on different processing cores. Multithreading Models Many-to-One Model The many-to-one model (Figure 4.5) maps many user-level threads to one kernel thread. Thread management is done by the thread library in user space, so it is efficient (we discuss thread libraries in Section 4.4). However, the entire process will block if a thread makes a blocking system call. Also, because only one thread can access the kernel at a time, multiple threads are unable to run. Solaris systems and adopted in early versions of Java—used the many-to-one model.
  • 2. One-to-One Model The one-to-one model (Figure 4.6) maps each user thread to a kernel thread. It provides more concurrency than the many-to-one model by allowing another thread to run when a thread makes a blocking system call. It also allows multiple threads to run in parallel on multiprocessors. The only drawback to this model is that creating a user thread requires creating the corresponding kernel thread. Many-to-Many Model The many-to-many model (Figure 4.7) multiplexes many user-level threads to a smaller or equal number of kernel threads. Let’s consider the effect of this design on concurrency. Whereas the many-to- one model allows the developer to create as many user threads as she wishes, it does not result in true concurrency, because the kernel can schedule only one thread at a time. The one-to- one model allows greater concurrency, but the developer has to be careful not to create too many threads within an application The many-to-many model suffers from neither of these shortcomings: developers can create as many user threads as necessary, and the corresponding kernel threads can run in parallel on a multiprocessor. Also, when a thread performs a blocking system call, the kernel can schedule another thread for execution.