OSY MICRO PROJECT
OSY MICRO PROJECT
PROJECT REPORT ON
“THREADS ”
SUBMITTED
BY
Name Enrollment no.
Ayush Jaywant Padval 2211450077
Chaitanya Vikas Patil 2211450045
Pranay Ganesh More 2211450039
Om Ganesh Chandgaonkar 2211450070
Prof.Asmita Patil
SUBMITTED TO
AT/POST:-NAGOTHANE-402106,TAL:-ROHA,DIST:-RAIGAD
AT/POST:-NAGOTHANE-402106,TAL:-ROHA,DIST:-RAIGAD
CERTIFICATE
DEPARTMENT OF COMPUTER ENGINNERING
• Skill Development
• Innovation and Creativity
• Hands-on Learning
• Team Collaboration
• Problem-Solving
• Real-World Application
(Microproject)
1.0 Introduction
A thread refers to a single sequential flow of activities being executed in a process;
Now, it is also known as the thread of execution or the thread of control. thread
execution is possible within any OS’s process. A part from that, a process can have
several threads. A distinct programme counter, a stack of activation records as well
as control blocks are used by each thread of the same process Thread is frequently
described as a light technique.
• Creating a new thread in a current process requires significantly less time than
creating a new process.
• Threads can share common data without needing to communicate with each
other.
• The procedure can be easily broken down into numerous different threads.
• MS Word employs many threads to prepare the text in one thread, receive input
in another thread and so on.
Types of Threads
1. User-level thread.
2. Kernel level thread.
1.User-level thread
The operating system does not recognize the user-level thread. User threads
can be easily implemented and it is implemented by the user. If a user
performs a user-level thread blocking operation, the whole process is blocked.
The kernel level thread does not know nothing about the user level thread. The
kernellevel thread manages user-level threads as if they are singlethreaded
processes? examples: Java thread, POSIX threads, etc.
2. The scheduler may decide to spend more CPU time in the process of threads
being large numerical.
3. The kernel-level thread is good for those applications that block the
frequency.
Disadvantages of Kernel-level threads
1. The kernel thread manages and schedules all threads.
2. The implementation of kernel threads is difficult than the user thread.
3. The kernel-level thread is slower than user-level threads.
Diagram:-
Benefits of Threads:-
o Enhanced throughput of the system: When the process is split into many
threads, and each thread is treated as a job, the number of jobs done in the unit time
increases. That is why the throughput of the system also increases.
o Effective Utilization of Multiprocessor system: When you have more than one
thread in one process, you can schedule more than one thread in more than one
processor.
o Faster context switch: The context switching period between threads is less than
the process context switching. The process context switch means more
overhead for the CPU.
o Responsiveness: When the process is split into several threads, and when a thread
completes its execution, that process can be responded to as soon as possible.
o Resource sharing: Resources can be shared between all threads within a process,
such as code, data, and files. Note: The stack and register cannot be shared between
threads. There is a stack and register for each thread.
MULTI-THREADING :-
Multithreading allows the execution of multiple parts of a program at the same time.
These parts are known as threads and are lightweight processes available within the
process. Therefore, multithreading leads to maximum utilization of the
CPU by multitasking
The main models for multithreading are one to one model, many to one model and
many to many model. Details about these are given as follows –
The one to one model maps each of the user threads to a kernel thread. This means
that many threads can run in parallel on multiprocessors and other threads can run
when one thread makes a blocking system call. A disadvantage of the one to one
model is that the creation of a user thread requires a corresponding kernel thread.
Since a lot of kernel threads burden the system, there is restriction on the number of
threads in the system.
Conclusion:
The exploration of software threads reveals their pivotal role in modern
computing environments. Threads are essential for enabling multitasking and
concurrent execution within applications, significantly enhancing performance
and responsiveness. This review has highlighted several critical aspects of
software threads, including their fundamental concepts, benefits, challenges, and
recent advancements.