You are on page 1of 11

Dr.

AMBEDKAR INSTITUTE OF TECHNOLOGY,


BENGALURU – 56
(An Autonomous Institution, Affiliated to VTU, Approved by AICTE, New Delhi,
Accredited by NAAC)

MASTER OF COMPUTER APPLICATIONS (MCA)

SAMINAR REPORT ON

“Thread”
II Semester

Subject Name: RM
Subject Code: 20MCA24

Submitted To:
Dr.Dharani

Assistant professor
MCA Department

Submited By:

Abdul Aziz(1DA20MCA001
B R Pawan(1DA20MC007)
Hemanth Kumar S K (1DA20MC019)
Venu Gopal S(1DA20MC056)
CONTENT

1.INTRODUCTION

2.WHAT IS THREAD

3.SINGLE AND MULTIPLE THREAD

4. PROCESSES VS THREAD

5. DIFFERENCE BETWEEN THREAD


AND PROCESS

6.TYPES OF THREADS
INTRODUCTION

 Thread is an execution unit that consists of its own program

counter, a stack, and a set of registers where the program

counter mainly keeps track of which instruction to execute next,

a set of registers mainly hold its current working variables, and

a stack mainly contains the history of execution

 Threads are also known as Lightweight processes.

 Threads are a popular way to improve the performance of an

application through parallelism.

 Threads are mainly used to represent a software approach in

order to improve the performance of an operating system just

by reducing the overhead thread that is mainly equivalent to a

classical process.

 The CPU switches rapidly back and forth among the threads

giving the illusion that the threads are running in parallel.


WHAT IS THREAD

 A Thread Is A Flow Of Execution Through The Process Code, With Its

Own Program Counter That Keeps Track Of Which Instruction To

Execute Next, System Registers Which Hold Its Current Working

Variables, And A Stack Which Contains The Execution History.

 A Thread Shares With Its Peer Threads Few Information Like Code

Segment, Data Segment And Open Files.

 When One Thread Alters A Code Segment Memory Item, All Other

Threads See That


SINGLE AND MULTI THREAD
Process Vs Thread :-
Threads operate in the same way as that of processes.
Some of the similarities and differences are:

Similarities

• Like processes, threads share CPU and only one


thread active (running) at a time.

• Like processes, threads within a process, execute


sequentially.

• Like processes, thread can create children.

• And like process, if one thread is blocked, another


thread can run.

Differences

• Unlike processes, threads are not independent of one


another.

• Unlike processes, all threads can access every address


in the task.

• Unlike processes, threads are designed to assist one


another. Note that

processes might or might not assist one another


because processes may originate from different
users.
Difference between Process and Thread
TYPES OF THREADS

 There are two types of threads :


 User Threads
 Kernel Threads

User Level Threads:-


 In this case, the thread management kernel is
not aware of the existence of threads.
 These are user managed 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 starts with a single thread.
Kernel Level Threads:-

• In this case, thread management is 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.
• Scheduling by the Kernel is done on a thread
basis.
• The Kernel performs thread creation, scheduling
and management in Kernel space.
• Kernel threads are generally slower to create
and manage than the user threads.
Advantages of Thread:-

• Threads minimize the context switching time.


• Use of threads provides concurrency within a
process.
• Efficient communication.
• It is more economical to create and context
switch threads.
• Threads allow utilization of multiprocessor
architectures to a greater scale and efficiency.
THANK YOU

You might also like