Presentation On Thread
Presentation On Thread
SYSTEM)
Group Members: Priyanka Rai,
Smriti Rumba, Nangsal Bomjan
& Binita Waiba
• WHAT IS THREAD ??
Thread is a sequence flow of task within a process. It is a path of
execution within a process. process contain multiple thread. A thread
is also called light weight process. It provides a way to improve
application performance through parallelism. Each thread belongs to
exactly one process and no thread can exist outside process.
IMORTANCE
• Threads run in parallel improving the application performance. Each such
thread has its own CPU state and stack, but they share the address
space of the process and the environment.
• Threads can share common data so they do not need to use
inter-process communication. like the processes, threads also have
states like ready, executing, blocked, etc.
• Each thread has its own Thread Control Block (TCB). like the process, a
context switch occurs for the thread, and register contents are saved in
(TCB).
COMPONENTS OF THREADS
• Stack Space
• Register Set
• Program Counter
• TYPES OF THREAD IN OPERATING SYSTEM
1. User Level Thread : User level thread is implemented in the user level
library, they are not created using the system calls.
• User-level threads are implemented by user. Kernel knows nothing about user
level thread.
• Each process needs its own private thread Table which consistence of program
counter Stack, pointer, register etc. Thread table managed by runtime system.
ADVANTAGES OF USER-LEVEL
DISADVANTAGES OF USER-LEVEL
THREAD
THREAD
The user threads can be easily
implemented than the kernel thread.
It is faster and efficient. • User-level threads lack coordination
Context switch time is shorter than the between the thread and the kernel.
kernel-level threads. • If a thread causes a page fault, the
It does not require modifications of the entire process is blocked.
operating system.
User-level threads representation is very
simple. the register, pc, stack, and mini
thread control blocks are stored in the
address space of the user-level process.
It is simple to create, switch, and
synchronize threads without the
intervention of the process.
2. Kernel Level Thread: The kernel thread recognizes the operating
system.
• Thread management is done by the kernel.
• No thread table each process.
• Information stored in kernel instinct of UserSpace.
• The kernel-level thread offers a system call to create and manage the
threads from user-space. the implementation of kernel threads is more
difficult than the user thread. context switch time is longer in the kernel
thread.
DISADVANTAGES
ADVANTAGES
• Multiple threads of the same process can • Slow and inefficient.
be scheduled on different processors in
• It requires thread control block so it is an
kernel-level threads.
overhead.
• The kernel routines can also be
• Kernel-level threads are not generic and
multithreaded.
are specific to the operating system.
• If a kernel-level thread is blocked, another
• Kernel-level threads are not as easy to
thread of the same process can be
manage as user-level threads.
scheduled by the kernel.
Differentiate Between Process And
Process
Thread Thread
1. When a program is under execution , 1. A segment of process is known as
then is known as a process. thread.
2. If one process is obstructed then it 2. If one thread is obstructed then it will
will not affect the operation of another affect the execution of another process.
process.
3. The process is less efficient in terms 3. Thread is more efficient in terms of
of communication. communication.
4. It takes more time for creation. 4. It takes less time for creation .
5. A system call is involved in it. 5.created No system call is involved, it
is created using APIs.
6. The process does not share data 6. Threads share data with each other.
each other.
7. If one process is blocked, then it will 7. If a user-level thread is blocked, then
not affect the execution of other all other user-level threads are blocked.
processes.
8. The process takes more time to 8. The thread takes less time to
terminate. terminate.
• ADVANTAGES OF THREAD
o Threads improve the overall performance of a program.
o Threads increases the responsiveness of the program
o Context switching time in threads is faster.
o Threads share the same memory and resources within a process.
o Communication is faster in threads.
o Threads provide concurrency within a process.
o Enhanced throughput of the system.
o Since different threads can run parallelly, threading enables the
utilization of the multiprocessor architecture to a greater extent
and increases efficiency.
THANK YOU !!