SlideShare a Scribd company logo
1 of 10
MULTITHREADING
SYNOPSIS:
 MUTITHREADING
 CREATION OFTHREAD
 THREAD LIFE CYCLE
 THREAD PRIORITIESAND SCHEDULING
 THREAD SYNCHRONIZATION
 DAEMONTHREAD
 THREAD GROUPS
 COMMUNICATION OFTHREADS
MULTITHREADING:
 Multithreading is a Java feature that allows
concurrent execution of two or more parts of
a program for maximum utilization of CPU.
Each part of such program is called a thread.
So, threads are light-weight processes within
a process.
CREATION OF THREAD
 Java is inherently multi-threaded. A
single Java program can have many different
threads executing independently and
continuously.Three Java applets on the same
page can run together with each getting
equal time from the CPU with very little extra
effort on the part of the programmer
THREAD LIFE CYCLE:
THREAD PRIORITIES AND
SCHEDULING:
 Scheduling of the CPU is fully preemptive. If
a thread with a higher priority than the
currently executing thread needs to execute,
the higher priority thread isimmediately
scheduled.The Java runtime will not preempt
the currently runningthread
for another thread of the same priority.
THREAD SYNCHRONIZATION:
 At times when more than one thread try to
access a shared resource, we need to ensure
that resource will be used by only one thread
at a time.The process by which this is
achieved is called synchronization.
Thesynchronization keyword in java creates
a block of code referred to as critical section.
DAEMON THREAD:
 A daemon thread is a thread that does not
prevent the JVM from exiting when the
program finishes but the thread is still
running. An example for a daemon thread is
the garbage collection.You can use the
setDaemon(boolean) method to change
the Thread daemon properties before
the threadstarts.

THREAD GROUPS:
COMMUNICATION OF THREAD:
 Inter thread Communication. Java provide
benefits of avoiding thread pooling using
inter-thread communication.The wait(),
notify() and notify all() methods of Object
class are used for this purpose.These method
are implemented as final methods in Object,
so that all classes have them.

More Related Content

What's hot

Slot02 concurrency1
Slot02 concurrency1Slot02 concurrency1
Slot02 concurrency1
Viên Mai
 
Operating System 4
Operating System 4Operating System 4
Operating System 4
tech2click
 

What's hot (20)

Multithreading Presentation
Multithreading PresentationMultithreading Presentation
Multithreading Presentation
 
Java-7 Concurrency
Java-7 ConcurrencyJava-7 Concurrency
Java-7 Concurrency
 
Inside the jvm
Inside the jvmInside the jvm
Inside the jvm
 
Java Virtual Machine
Java Virtual Machine Java Virtual Machine
Java Virtual Machine
 
JRuby - Programmer's Best Friend on JVM
JRuby - Programmer's Best Friend on JVMJRuby - Programmer's Best Friend on JVM
JRuby - Programmer's Best Friend on JVM
 
Java-java virtual machine
Java-java virtual machineJava-java virtual machine
Java-java virtual machine
 
Java Virtual Machine - Internal Architecture
Java Virtual Machine - Internal ArchitectureJava Virtual Machine - Internal Architecture
Java Virtual Machine - Internal Architecture
 
The Real Thing: Java Virtual Machine
The Real Thing: Java Virtual MachineThe Real Thing: Java Virtual Machine
The Real Thing: Java Virtual Machine
 
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVMJava Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
 
Jdk,jre,jvm
Jdk,jre,jvmJdk,jre,jvm
Jdk,jre,jvm
 
JVM- Java Virtual Machine
JVM- Java Virtual MachineJVM- Java Virtual Machine
JVM- Java Virtual Machine
 
Java introduction with JVM architecture
Java introduction with JVM architectureJava introduction with JVM architecture
Java introduction with JVM architecture
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
 
JDK,JRE,JVM
JDK,JRE,JVMJDK,JRE,JVM
JDK,JRE,JVM
 
Slot02 concurrency1
Slot02 concurrency1Slot02 concurrency1
Slot02 concurrency1
 
Operating System 4
Operating System 4Operating System 4
Operating System 4
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
 
QSpiders - Memory (JVM architecture)
QSpiders - Memory (JVM architecture)QSpiders - Memory (JVM architecture)
QSpiders - Memory (JVM architecture)
 
threads and its types ....in operating system ..
threads and its types ....in operating system ..threads and its types ....in operating system ..
threads and its types ....in operating system ..
 
Multi threading models(operating systems)
Multi threading models(operating systems)Multi threading models(operating systems)
Multi threading models(operating systems)
 

Similar to Multithreading.

Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
Raghu nath
 

Similar to Multithreading. (20)

Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Java Multithreading and Concurrency
Java Multithreading and ConcurrencyJava Multithreading and Concurrency
Java Multithreading and Concurrency
 
Multithreading in-java
Multithreading in-javaMultithreading in-java
Multithreading in-java
 
Thread
ThreadThread
Thread
 
Multithread Programing in Java
Multithread Programing in JavaMultithread Programing in Java
Multithread Programing in Java
 
Threadnotes
ThreadnotesThreadnotes
Threadnotes
 
8.-OBJECT-ORIENTED-PROGRAMMING-USING-JAVA-Multithreading.pptx
8.-OBJECT-ORIENTED-PROGRAMMING-USING-JAVA-Multithreading.pptx8.-OBJECT-ORIENTED-PROGRAMMING-USING-JAVA-Multithreading.pptx
8.-OBJECT-ORIENTED-PROGRAMMING-USING-JAVA-Multithreading.pptx
 
Thread priorities in java
Thread priorities in javaThread priorities in java
Thread priorities in java
 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
 
Java Threads
Java ThreadsJava Threads
Java Threads
 
Multi t hreading_14_10
Multi t hreading_14_10Multi t hreading_14_10
Multi t hreading_14_10
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Core Java interview questions-ppt
Core Java interview questions-pptCore Java interview questions-ppt
Core Java interview questions-ppt
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in android
 
Basic java part_ii
Basic java part_iiBasic java part_ii
Basic java part_ii
 
Md09 multithreading
Md09 multithreadingMd09 multithreading
Md09 multithreading
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 

Multithreading.

  • 2. SYNOPSIS:  MUTITHREADING  CREATION OFTHREAD  THREAD LIFE CYCLE  THREAD PRIORITIESAND SCHEDULING  THREAD SYNCHRONIZATION  DAEMONTHREAD  THREAD GROUPS  COMMUNICATION OFTHREADS
  • 3. MULTITHREADING:  Multithreading is a Java feature that allows concurrent execution of two or more parts of a program for maximum utilization of CPU. Each part of such program is called a thread. So, threads are light-weight processes within a process.
  • 4. CREATION OF THREAD  Java is inherently multi-threaded. A single Java program can have many different threads executing independently and continuously.Three Java applets on the same page can run together with each getting equal time from the CPU with very little extra effort on the part of the programmer
  • 6. THREAD PRIORITIES AND SCHEDULING:  Scheduling of the CPU is fully preemptive. If a thread with a higher priority than the currently executing thread needs to execute, the higher priority thread isimmediately scheduled.The Java runtime will not preempt the currently runningthread for another thread of the same priority.
  • 7. THREAD SYNCHRONIZATION:  At times when more than one thread try to access a shared resource, we need to ensure that resource will be used by only one thread at a time.The process by which this is achieved is called synchronization. Thesynchronization keyword in java creates a block of code referred to as critical section.
  • 8. DAEMON THREAD:  A daemon thread is a thread that does not prevent the JVM from exiting when the program finishes but the thread is still running. An example for a daemon thread is the garbage collection.You can use the setDaemon(boolean) method to change the Thread daemon properties before the threadstarts. 
  • 10. COMMUNICATION OF THREAD:  Inter thread Communication. Java provide benefits of avoiding thread pooling using inter-thread communication.The wait(), notify() and notify all() methods of Object class are used for this purpose.These method are implemented as final methods in Object, so that all classes have them.