0% found this document useful (0 votes)
49 views18 pages

O Sy Micro Project

Uploaded by

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

O Sy Micro Project

Uploaded by

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

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

VIDYAVARDHINI’S BHAUSAHEB VARTAK


POLYTECHNIC

MICRO PROJECT
Academic year: 2024-2025
Title of Micro Project:
Threads in Operating System
Program/Code: Computer Engineering (CO-2) Semester: FIFTH

Course/Code: Operating System (22516)

Name: Roll No:

Enrollment No.:

Name of Faculty: Mrs. Amrita Rathod


MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION

Certificate

This is to certify that Mr. /Ms.……………………………………………………………


Roll No…………… of Fifth Semester of Diploma in Computer Engineering- I (CO-II)
of Institute, B.V. POLYTECHNIC (Code: 0093) has completed the Micro-Project
satisfactorily in Subject– Operating System (22516) for the academic year 2024- 2025
as prescribed in the curriculum.

Place: Vasai Enrollment No: ……………………………………

Date: ……………………… Exam. Seat No: …………………………………….

Subject Teacher Head of the Department Principal


Seal Of
Institution

Annexure – I

Part A: Micro Project Proposal


1.0 Aim/Benefits of the Micro-Project:
The aim of a microproject on threads in operating systems is to explore the fundamentals of threading,
including creation, management, and synchronization mechanisms. It seeks to demonstrate the benefits
of multithreading through practical implementations, performance evaluations in real-world applications.
2.0 Course Outcomes integrated:
1. Understanding of thread concepts and their role in multitasking.
2. Knowledge of thread management and synchronization.
3. Ability to implement multithreading in applications.
4. Awareness of challenges and best practices in multithreading.

3.0 Proposed Methodology:


1. Literature survey.
2. Collect information through different sources.
3. Analysis of data.
4. Compilation of collected data.

4.0 Action Plan


Sr. Planned Planned Name of
No. Details of the activity Start date Finish date Members
1 Formation of Group & Topic Selection All members
2 Submission of Proposed Plan All members
3 Preparation of Report All members
4 Final valuation of a working Report All members
5 Presentation of Report All members
6 Submission of Final Report All members

5.0 Resource Required:


Sr.
Name of resources/Material Specifications Qty Remarks
No.
Processor: i3
1. Computer 1
RAM : 4.00 GB
2. Microsoft Word Word -2016 1
3. Printer Hp Laser Jet 1
https://www.academia.edu 1
4. Book/ website name

6.0 Name of Team Members with Roll No:

Sr. Process and Individual Total


No. Roll No Name of Students Product Presentation (10)
assessment (04)
(06)
01 1931 Bhadavankar Anjali Sanjay

02 1932 D’mello Bethan Ranjit

03 1933 Fonseca Cian Kelvin

Name & Signature of Faculty: Mrs. Amrita Rathod


Annexure- II
Final Micro Project Report

Title: Threads in Operating System.

1.0 Rationale The introduction to operating systems is essential for understanding how computer
systems manage hardware and software resources efficiently. It provides a foundational framework
for grasping concepts like process management, memory allocation, and file systems. This
knowledge is crucial for developing effective software and optimizing performance, making it
integral for students pursuing careers in computer science and software engineering.

2.0 Course Outcomes Integrated:


1. Understanding of thread concepts and their role in multitasking.
2. Knowledge of thread management and synchronization.
3. Ability to implement multithreading in applications.
4. Awareness of challenges and best practices in multithreading.

3.0 Actual Procedure Followed.


1 Discussion about topic with guide and among group members.
2 Literature survey.
3 Information collection.
4 Compilation of content.
5 Editing and revising content.
6 Report Preparation.
4.0 Actual Resources Required:

Sr.
Name of resources/Material Specifications Qty Remarks
No.
Processor: i3
1. Computer 1
RAM : 4.00 GB
2. Microsoft Word Word -2016 1
3. Printer Hp Laser Jet 1
https://www.academia.edu 1
4. Book/Site name

5.0 Skill Developed/Learning outcomes of this Micro-Project


The following skills were developed:
1. Teamwork: Learned to work in a team and boost individual confidence.
2. Problem-Solving: Developed good problem solving habits.
3. Technical Writing: Preparing the report of proposed plan and the final report.

Annexure - III
Rubrics for Assessment of Micro-Project

Title: Threads in Operating System.


Institute Code: 0093 Academic year: 2024-25

Program: CO-II Course & Code: OSY (22516)

Name of Candidate: Roll No:

Semester: Fifth Name of Faculty: Mrs. Amrita Rathod

Sr. Poor Average Good Excellent


No. Characteristic to be Assessed (Marks 1-3) (Marks 4-5) (Marks 6-8) (Marks 9-10)

1. Relevance to the Course


Literature Survey/Information
2.
Collection
3. Project Proposal
Completion of the Target as per
4.
Project Proposal
5. Analysis of Data and Representation
6. Quality of Prototype/Model
7. Report Preparation
8. Presentation
9. Viva
Annexure- IV

Micro-Project Evaluation Sheet


Title: Threads in Operating System.

Institute Code: 0093 Academic year: 2024-25


Program: CO-II Course & Code: OSY (22516)
Name of Candidate: Roll No:
Semester: Fifth Name of Faculty: Mrs. Amrita Rathod
Course Outcomes Achieved:
1. Acquired skills in thread management and synchronization.
2. Developed capability to implement multithreading in software.
3. Gained awareness of multithreading challenges and solutions.
Evaluation as per Suggested Rubric for Assessment of Micro Project:
Sr. Characteristic to be Poor Average Good Marks Excellent Sub
No. assessed Marks Marks 4-5 6-8 Marks 9-10 Total
1-3
(A) Process and product assessment Out Of 6

1 Relevance to the course

2 Literature Survey .
Information Collection

3 Completion of the
Target as per project
proposal

4 Analysis of Data and


representation

5 Quality of Prototype/
Model/Content
6 Report Preparation

(B) Individual Presentation/Viva Out of 4

7 Presentation

8 Viva

Name and designation of the Faculty Member: Mrs. Amrita Rathod.


Weekly Activity Sheet
Topic: Threads in Operating System.

Institute Code: 0093 Academic year: 2024-2025

Program: CO-II Course & Code: OSY (22516)

Name of Candidate: Roll No:

Semester: Fifth Name of Faculty: Mrs. Amrita Rathod

SR. NO WEEK ACTIVITY PERFORMED


1. 1st Week Discussion and Finalization of Topic

2. 2nd Week Literature Review

3. 3rd Week Submission of Proposed Plan

4 4th Week Information Collection

5. 5th Week Analysis of Data

6. 6th Week Compilation of content

7. 7th Week Editing and Revising the Content

8. 8th Week Report Preparation

9. 9th Week Report Preparation

10. 10th- 12th Week Presentation

Signature of Student Dated Signature of Faculty


Index

Sr. No. Content Page No

1. Acknowledgement 01

2. Introduction 02

3. Benefits of Multithreading 03

4. Types of Threads 04

5. Multithreading Models 06

6. Conclusion 09

7. References 09

0
ACKNOWLEDGEMENT

We would like to express our special thanks or gratitude to our professor


Mrs. Amrita Rathod for guiding and supporting us in completing the
Micro-project. Her advices helped us tremendously all the time. We are
deeply indebted to her as without her constructive feedback this project
would not have been a success.
Also, profound gratitude towards all the group members, as without their
kind support it would not have been possible for completion of this Micro-
project. We could learn a lot of things through this Micro-project. Once again,
we thank all those who have encouraged and helped in making this project

1
Introduction

A thread is a basic unit of CPU utilization.


A thread is defined, " as a unit of concurrency within a process and had access to the
entire code and data parts of the process". Thus, thread of the same process can share
their code and data with one another. Thread is associated with thread ID, a program
counter a register set and a stack.
Generally a traditional process has a single thread but process can be multithreaded also
If the system is multithreaded control system then it is very powerful as it can perform
multiple tasks at a time
Modern operating systems are multithreaded. operating system and that makes them:
very powerful, one process if have multiple threads, then multiple tasks takes place.
For eg. a web browser which has many threads. one thread may display images, some
may display text, some may be other. Links lire data from network etc.
Threads enhance the capability of operating systems to efficiently utilize CPU resources,
facilitate concurrent execution of tasks, and improve application responsiveness. Their
design and implementation reflect a balance between performance, complexity, and ease
of programming, making them indispensable in the architecture of contemporary
computing environments.

2
Benefits of Multithreading

1.Responsiveness :-
-Multithreading operating systems are interactive systems or applications. This
environment may allow program to execute or run continuously even if the part of it is
blocked or it may be performing a lengthy operation. This is known as responsiveness to
the user.

2. Resource Sharing:-
- Resources like code, data and file can be shared among all threads within a process.
- The advantage of sharing code and data is that it allows an application to have many
threads activity within the same address space of process.

3. Economy:-
- Allocating memory and resources for process creation is costly. Alternatively, because
threads share resources of the process to which they belong, it is more economical to
create and context switch threads.
- The overhead of creating and managing processes is much more than creating and
managing threads.

4.Utilization of multiprocessor architecture :-


The benefits of multithreading can be greatly increased in a multiprocessor architecture,
where each thread may be running in parallel on a different processor.
A single threaded process can only run on one CPU, no matter how many are available
Multithreading on a multi- CPU machine increase concurrency.

3
Types of threads
Threads are implemented in two ways:
1. User Level
2. Kernel Level
1.User Level Thread:

In a user thread, all of the work of thread management is done by the application and the
kernel is not aware of the existence of threads. The thread library contains code for
creating and destroying threads, for passing message and data between threads, for
scheduling thread execution and for saving and restoring thread contexts. The
application begins with a single thread and begins running in that thread
1. A user-level thread is a thread within a process which the OS does not know about.
2. In a user-level thread approach the cost of a context switch between threads is less
since the operating system itself does not need to be involved-no extra system calls are
required.
3. A user-level thread is represented by a program counter, registers, stack, and small
thread control block (TCB).
4. Programmers typically use a thread library to simplify management of threads within
a process.
5. Creating a new thread, switching between threads, and synchronizing threads are done
via function calls into the library. This provides an interface for creating and stopping
threads, as well as control over how they are scheduled.
Advantage of user level thread over Kernel level thread:
1. Thread switching does not require Kernel mode privileges.
2.User level thread can run on any operating system.
Disadvantages of user level thread :
1. In a typical operating system, most system calls are blocking.
2. Multithreaded application cannot take advantage of multiprocessing.
4
2. Kernel Level Thread:

In Kernel level thread, thread management done by the Kernel. There is no thread
management code in the application area. Kernel threads are supported directly by the
operating system. Any application can be programmed to be multithreaded. All of the
threads within an application are supported within a single process. The Kernel
maintains context information for the process as a whole and for individuals threads
within the process.
1. In systems that use kernel-level threads, the operating system itself is aware of each
individual thread.
2. Kernel threads are supported and managed directly by the operating system.
3. A context switch between kernel threads belonging to the same process requires only
the registers, program counter, and stack to be changed; the overall memory
management information does not need to be switched since both of the threads share
the same address space. Thus context switching between two kernel threads is slightly
faster than switching between two processes.
4. Kernel threads can be expensive because system calls are required to switch between
threads.
5. Also, since the operating system is responsible for scheduling the threads, the
application does not have any control over how its threads are managed.
Advantages of Kernel level thread:
1. Kernel can simultaneously schedule multiple threads from the same process on
multiple processes.
2. Kernel routines themselves can multithreaded.
Disadvantages:
1. Kernel threads are generally slower to create and manage than the user threads.
2. Transfer of control from one thread to another within same process requires a mode
switch to the Kernel.

5
multithreading models
Many systems provide support for both user and kernel threads, resulting in different
multithreading models.
1.One-to-One Model:

 The one-to-one model maps each user thread to a kernel thread.


 It provides more concurrency than 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.
 Examples:-Windows NT, Windows 2000,Linux and OS12 implement the one-to-
one model.
Advantages:
1. More concurrency because of multiple threads can run in parallel on multiple
CPU’s.
2. Less complication in processing.
Disadvantages:
1. Thread creation involves Light Weight Process creation.
2. Every time with user's thread, kernel thread is created.
3. It reduces the performance of system.

6
2.Many-to-One Model:

 The many-to-one model maps many user level threads to one kernel thread.
 Thread management is done in user space, so it is efficient, but the entire process
will block if a thread makes a blocking system call.
 Only one thread can access the kernel at a time. Multiple threads are unable to run
in parallel on multiprocessors.
 Example:- Green threads-a thread library available for Solaris uses this model, as
does GNU Portable Threads.
Advantages:
1. Totally portable.
2. Efficient system in terms of performance.
3. One kernel thread controls multiple user threads.
4. Mainly used in language system, portable Libraries.

Disadvantages:
1. Cannot take advantage of parallelism.
2. one block can block all user threads.

7
3.Many-to-Many Model:

 The many-to-many model multiplexes many user level threads to a smaller or


equal number of kernel threads.
 The number of kernel threads may be specific to either a particular application or
a particular machine.
 This model allows developer to create as many threads. Concurrency is not gained
because the kernel can schedule only one thread at a time.
 Examples:- Solaris 2 and Windows NT/2000 with the Thread Fiber package.

Advantages:
1. Many threads can be created as per user's requirement.
2. Multiple kernel or equal to user threads can be created.

Disadvantages:
1. True concurrency cannot be achieved.
2. Multiple threads of kernel is an overhead for operating system.
3. Performance is less.

8
Conclusion:
1. Lightweight Nature: Threads share the same memory space within a process,
making them lighter than processes. This allows for faster context switching and
reduced overhead.
2. Concurrency: By enabling multiple threads to run concurrently, applications can
perform better, particularly in I/O-bound and CPU-bound tasks. This is crucial for
modern applications that require responsiveness.
3. Resource Sharing: Threads within the same process share resources, such as
memory and file descriptors, which simplifies communication and data sharing.
4. Synchronization Challenges: While sharing resources simplifies some aspects, it
also introduces challenges related to synchronization and data consistency.
Mechanisms like mutexes and semaphores are essential for avoiding race
conditions.
5. Thread Management: Operating systems provide various APIs for thread creation,
scheduling, and management, which developers can use to implement
multithreading in their applications.
6. Applications: Multithreading is widely used in web servers, real-time applications,
and GUI applications, enhancing performance and user experience.
In conclusion, threads are fundamental to the efficient operation of modern operating
systems, enabling enhanced performance, resource utilization, and responsiveness in
applications. However, careful management and synchronization are vital to prevent
issues arising from concurrent execution.

References:
 OSY chapter 3 notes by prof. Amrita Rathod.
 https://tutorialwing.com/user-level-thread-and-kernel-level-thread-with-example/
#google_vignette
 https://www.geeksforgeeks.org/multi-threading-models-in-process-management/
 https://www.scaler.com/topics/operating-system/threads-in-operating-system/
 https://www.tutorialspoint.com/operating_system/os_multi_threading.htm

You might also like