SlideShare a Scribd company logo
THREAD
MADE BY
POOJA ROY
1
THREAD
 Threading is a facility to allow multiple activities to coexist within a single
process.
 Threads are sometimes referred to as lightweight processes. Like
processes, threads are independent, concurrent paths of execution
through a program, and each thread has its own stack.
2
Why use threads?
•Take advantage of multiprocessor systems
•Simplify modeling
•Perform asynchronous or background processing
3
Life cycle of a Thread (Thread States)
 The life cycle of the thread in java is controlled by JVM. The java thread
states are as follows:
 New
 Runnable
 Running
 Non-Runnable (Blocked)
 Terminated
4
Life cycle of a Thread 5
Life cycle of a Thread
 1) New
 The thread is in new state if you create an instance of Thread class but
before the invocation of start() method.
 2) Runnable
 The thread is in runnable state after invocation of start() method, but the
thread scheduler has not selected it to be the running thread.
 3) Running
 The thread is in running state if the thread scheduler has selected it.
6
Life cycle of a Thread
 4) Non-Runnable (Blocked)
 This is the state when the thread is still alive, but is currently not eligible to
run.
 5) Terminated
 A thread is in terminated or dead state when its run() method exits.
7
Thank you
8

More Related Content

PPTX
Thread.ppt
PPTX
Thread&multithread
PDF
Java threads
PPT
Java Threads
PPTX
Thread presentation
PPTX
Multi threading
PPTX
Java Multi Thead Programming
PPT
Java And Multithreading
Thread.ppt
Thread&multithread
Java threads
Java Threads
Thread presentation
Multi threading
Java Multi Thead Programming
Java And Multithreading

What's hot (20)

PPTX
PPTX
Multithreading in java
PPTX
THREADS of Operating System by Noman Zahid
PPTX
PPT
Thread model in java
PPT
Chap2 2 1
PDF
Java threading
PPT
Thread priorities35
PDF
Threads concept in java
PPTX
PPTX
Thread priorities
PPTX
threads and its types ....in operating system ..
PDF
Java thread life cycle
PPTX
Thread (Operating System)
PPTX
Operating system: threads(mulithreading,benefits of threads, types of thread)
PPTX
Internet Programming with Java
PPTX
Multithreading.
PPTX
Threads in Java
PPTX
Threads (operating System)
Multithreading in java
THREADS of Operating System by Noman Zahid
Thread model in java
Chap2 2 1
Java threading
Thread priorities35
Threads concept in java
Thread priorities
threads and its types ....in operating system ..
Java thread life cycle
Thread (Operating System)
Operating system: threads(mulithreading,benefits of threads, types of thread)
Internet Programming with Java
Multithreading.
Threads in Java
Threads (operating System)
Ad

Similar to Thread.ppt (20)

PPTX
JAVA THEORY PPT.pptx on based up on the transaction
PPTX
L22 multi-threading-introduction
PDF
Multithreading Introduction and Lifecyle of thread
PPTX
Multi-Threading in Java power point presenetation
PPTX
Thread Concept: Multithreading, Creating thread using thread
PPT
Basic of Multithreading in JAva
PPTX
Multithreading.pptx
PPT
7. Multithreading
PDF
Java unit 12
PDF
Multi threading
PDF
JAVA Threads explained
PPTX
Multithreading in java
PPT
java multi threading and synchronisation.ppt
PDF
CSE 3146 M1- MULTI THREADING USING JAVA .pdf
PPTX
multithreading,thread and processinjava-210302183809.pptx
PPTX
Multithreading in Java Object Oriented Programming language
PPT
Lec7!JavaThreads.ppt
PPT
Lec7!JavaThreads.ppt java multithreading
PPTX
Multithreading in java
JAVA THEORY PPT.pptx on based up on the transaction
L22 multi-threading-introduction
Multithreading Introduction and Lifecyle of thread
Multi-Threading in Java power point presenetation
Thread Concept: Multithreading, Creating thread using thread
Basic of Multithreading in JAva
Multithreading.pptx
7. Multithreading
Java unit 12
Multi threading
JAVA Threads explained
Multithreading in java
java multi threading and synchronisation.ppt
CSE 3146 M1- MULTI THREADING USING JAVA .pdf
multithreading,thread and processinjava-210302183809.pptx
Multithreading in Java Object Oriented Programming language
Lec7!JavaThreads.ppt
Lec7!JavaThreads.ppt java multithreading
Multithreading in java
Ad

More from pooja kumari (9)

PPTX
Voice recognition
PPTX
PDF
DOCX
Introduction to linked lists
PPTX
Exception handling in java
PPTX
Exception handling in java
PPTX
Applet
PPT
Exception handling
DOCX
Sql seuence and sub queries
Voice recognition
Introduction to linked lists
Exception handling in java
Exception handling in java
Applet
Exception handling
Sql seuence and sub queries

Recently uploaded (20)

PDF
Pre independence Education in Inndia.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Cell Structure & Organelles in detailed.
PDF
Sports Quiz easy sports quiz sports quiz
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Insiders guide to clinical Medicine.pdf
PPTX
master seminar digital applications in india
PDF
Classroom Observation Tools for Teachers
PDF
Computing-Curriculum for Schools in Ghana
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
Pre independence Education in Inndia.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Cell Structure & Organelles in detailed.
Sports Quiz easy sports quiz sports quiz
TR - Agricultural Crops Production NC III.pdf
Basic Mud Logging Guide for educational purpose
O5-L3 Freight Transport Ops (International) V1.pdf
Insiders guide to clinical Medicine.pdf
master seminar digital applications in india
Classroom Observation Tools for Teachers
Computing-Curriculum for Schools in Ghana
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
2.FourierTransform-ShortQuestionswithAnswers.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Microbial diseases, their pathogenesis and prophylaxis
human mycosis Human fungal infections are called human mycosis..pptx

Thread.ppt

  • 2. THREAD  Threading is a facility to allow multiple activities to coexist within a single process.  Threads are sometimes referred to as lightweight processes. Like processes, threads are independent, concurrent paths of execution through a program, and each thread has its own stack. 2
  • 3. Why use threads? •Take advantage of multiprocessor systems •Simplify modeling •Perform asynchronous or background processing 3
  • 4. Life cycle of a Thread (Thread States)  The life cycle of the thread in java is controlled by JVM. The java thread states are as follows:  New  Runnable  Running  Non-Runnable (Blocked)  Terminated 4
  • 5. Life cycle of a Thread 5
  • 6. Life cycle of a Thread  1) New  The thread is in new state if you create an instance of Thread class but before the invocation of start() method.  2) Runnable  The thread is in runnable state after invocation of start() method, but the thread scheduler has not selected it to be the running thread.  3) Running  The thread is in running state if the thread scheduler has selected it. 6
  • 7. Life cycle of a Thread  4) Non-Runnable (Blocked)  This is the state when the thread is still alive, but is currently not eligible to run.  5) Terminated  A thread is in terminated or dead state when its run() method exits. 7