0% found this document useful (0 votes)
20 views7 pages

THREADS

Uploaded by

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

THREADS

Uploaded by

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

Threads In Operating system

Lightweight Processes ->


Threads are units of execution within a process,
sharing the same memory space and resources.
They are often called "lightweight processes"
due to their low overhead.

Concurrency ->Threads enable concurrency by allowing


multiple tasks to execute concurrently within a
single process. This can significantly improve
performance and responsiveness.
Benefits of Threads
Improved
1 Responsiveness Resource Sharing
2
Threads within a process
Threads allow applications
share the same memory
to be more responsive to
space and resources,
user input or events. While
reducing the overhead of
one thread is busy, another
creating and managing
can handle incoming
separate processes.
requests.
Increased Simplified
3 Performance 4 Programming
By parallelizing tasks Threads can simplify the
across multiple threads, development of complex
applications can take applications by allowing
advantage of multi-core tasks to be broken down
processors to improve into smaller, independent
overall performance. units.
Thread Creation and Management

Thread Creation Thread Synchronization


Threads are created using system Synchronization mechanisms like
calls or library functions. This mutexes and semaphores are
involves allocating resources and used to coordinate access to
initializing the thread's execution shared resources by multiple
context. threads.

Thread Scheduling Thread Termination


The operating system schedules Threads can terminate normally or
threads for execution, deciding abnormally. Upon termination,
which thread gets access to the resources are released, and the
CPU at any given time. thread's state is cleared.
Types of Threads
User Threads Kernel Threads
Managed by the application itself, Managed by the kernel, kernel
user threads are lightweight and threads are more robust and
efficient. However, they are provide better scheduling and
dependent on the operating system synchronization capabilities. They
for scheduling and synchronization. offer better isolation and
protection.

Hybrid Threads
A combination of user and kernel threads, hybrid threads offer
the advantages of both types. They are often used to balance
efficiency and functionality.
Single-Threaded vs. Multi-Threaded
Processes

Single-Threaded
1 Sequential execution, simple to implement but can be slow and
unresponsive.

Multi-Threaded
Concurrent execution, can significantly improve
2 performance and responsiveness, but more complex to
manage.
Conclusion and Key Takeaways
->Threads are a fundamental concept in modern operating systems, allowing
efficient execution of tasks by splitting processes into smaller units of execution.

->They enhance system performance by enabling multitasking, better resource


utilization, and faster context switching compared to processes.

->By sharing memory and other resources within a process, threads provide a
lightweight and flexible mechanism for parallel execution, making them crucial in
handling complex applications.
THANK YOU
EFFORTS BY : DHWANI YADAV
B23CSE067
(202302626010146)

You might also like