[go: up one dir, main page]

0% found this document useful (0 votes)
7 views11 pages

Multi Threading Group 8.

The document provides an overview of multi-threading, defining a thread as a basic unit of execution within a process. It discusses the benefits of multi-threading, types of threads (user-level and kernel-level), and the differences between them. Additionally, it outlines various multi-threading models, including many-to-many, many-to-one, and one-to-one relationships.

Uploaded by

giftmtamu29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views11 pages

Multi Threading Group 8.

The document provides an overview of multi-threading, defining a thread as a basic unit of execution within a process. It discusses the benefits of multi-threading, types of threads (user-level and kernel-level), and the differences between them. Additionally, it outlines various multi-threading models, including many-to-many, many-to-one, and one-to-one relationships.

Uploaded by

giftmtamu29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Multi-threading.

1 6 5 4 7 7 L A B A N O TI E N O .

1 6 8 3 2 3 W A MB AR I MI C HA E L .

1 6 9 2 7 3 W A MB UA M AR I O N . GROUP
1 6 9 5 1 3 R Y AN N J AG I .

1 4 4 1 0 6 CH E L S E Y K I R U I . 8
1 4 5 8 8 8 G I FT I R UN G U
CONTENT.

DEFINITION OF A THREAD AND MULTI-THREADING.

BENEFITS OF MULTI-THREADING.

TYPES OF THREADS.

DIFFERENCE BETWEEN USER LEVEL AND KERNEL LEVEL THREADS.

MULTI-THREADING MODELS.
DEFINITION OF A THREAD
A thread is a basic unit of execution within the process, with it's own program counter that
keeps track of which instruction to execute next.

It contains of system registers which hold its current working variables and stack which
contain the execution history.

A process can have one thread known as single threading or more threads known as
multi-threading. This threads can execute simultaneously on and execute different sections
of the program.

Example: A web browser might use one thread to show a page and another to download
images at the same time.
BENEFITS OF MULTI-THREADING.
Increases responsiveness- Multi-threading allows a program to continue running even if
part of it is performing a lengthy operation thereby increasing responsiveness to the user.

Resource sharing- Threads share the memory and resources of the process to which they
belong. It allows an application to have multiple threads hence utilizes resources.

Reduces costs- allocating memory and resources for process creation is costly thus it is
more economical to use multi-threading.

Improved performance- Threads can run in parallel on separate CPU’ s allowing a program
to complete a task faster
TYPES OF THREADS
Threads are implemented in two ways;

a) User-level threads – In this case application manages thread management It is


managed by the user-level libraries. Example; Java threads.

b) Kernel threads – operating system managed threads acting on kernel. Examples;


Windows and Linux.
Difference between User Level &
Kernel.
User-Level Thread Kernel Level Thread

1 User level threads are faster to create and Kernel level threads are slower to create and
manage. manage.

2 Implementation is by a thread library at Operating system supports creation of kernel


the user level. threads.

3 They can run in any operating system Kernel level thread is specific to the
therefore they are generic. operating system.
MULTI-THREADING MODELS.
Some operating systems provide a combined user level and kernel level thread facility.

In a combined system multiple threads within the same program can run in parallel on
multiple processors.

Multithreading models are three types:

1. Many to Many relationship

2. Many to one relationship

3. One to one relationship.


Many to Many Model.
Many user level threads mapped to small/equal number of kernel threads.

Allows to create sufficient number of kernel threads so that can run in parallel.

This model provides the best accuracy on concurrency and when a thread perform a
blocking system block and when a thread performs a blocking system call, the kernel can
schedule another thread for execution.
Many-to-One Model
Many user-level threads mapped to single kernel thread.

Thread management done by user thread library.

One thread making blocking system call causes all to block.

Multiple threads may not run in parallel on multicore system because only one thread can
access kernel at a time.
One-to-one model.
Each user thread is mapped to a kernel thread.ie creating a user-level thread creates a
kernel thread.

More concurrency than many-to-one model. Allows another thread to run even if one blocks.

Example: Windows and Linux.


THANKYOU.

You might also like