#86 Multiple Threads in Java

  Рет қаралды 105,898

Telusko

Telusko

Жыл бұрын

Check out our courses:
Spring and Microservices Weekend Live Batch : bit.ly/spring-live-weekend
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : bit.ly/java-spring-cloud
Udemy Courses:
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
Java For Programmers:- bit.ly/javaProgrammers
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusko.com/
In this lecture we will learn:
- Multiple Threads in Java
- How to create a thread?
- How we can do parallel programming?
- start() and run() methods in multithreading
- Time-sharing between multiple threads
#1
When you build an application, we use certain frameworks and behind the scene, these frameworks will create threads.
- Every statement runs in a sequence in the main method.
- If you want to execute two behaviours to execute at the same time, then we can use threads.
- We can not execute normal objects in multiple threads or normal objects can not be executed simultaneously.
#2
- Java provides a Thread class to achieve thread programming. The thread class provides constructors and methods to create and perform operations on a thread.
- A thread can be created by extending the thread class. The thread class can be extended through the Thread keyword.
- By using the Thread keyword with class, it will not create a new thread.
#3
- We have to use the start() method in the main to start the execution of a new thread.
- start() is a method that is present inside the thread class. start() method only calls the run method.
- Start() invokes the run() method on the Thread object.
- run method should be present inside every thread to start a new thread.
- run() method is used to do an action for a thread.
#4
- All threads cannot run at the same time, so threads go for the time sharing.
-In this time-sharing Operating system, many processes are allocated with computer resources in respective time slots.
- Scheduler is responsible to allow which thread to execute at what time.
Github repo : github.com/navinreddy20/Javac...
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
More Learning :
Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6
JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq
Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA
Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB
NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L
Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
www.telusko.com

Пікірлер: 33
@Mona-3
@Mona-3 Жыл бұрын
Every one searching thread app and I am searching thread in java😢😢
@LV-ni2zu
@LV-ni2zu
Sir does all the misunderstandings and mistakes inside the tutorial so we don't need to do it and scratch our heads🙌🙌
@91-ritikjain36
@91-ritikjain36 Жыл бұрын
please sir make the new video of Servlet and JSP tooo
@krishnamoorthysridhar8536
@krishnamoorthysridhar8536 Жыл бұрын
Sir, Excellent Explanation.. The way of explaining the concept is so clear. Thanks a lot..
@ragulparajuli214
@ragulparajuli214
How do you get to see all the class details in vs code. Do we need to do something to see like that
@sayankarmakar13
@sayankarmakar13 Жыл бұрын
What a video ❤
@sathishbabu7824
@sathishbabu7824
No one can explain better than this. True masterclass.
@letnaturespeak6155
@letnaturespeak6155
If producer endpoint is slow itself then will threads benefits improving performance of consumer application?
@_HanuSaiR
@_HanuSaiR Жыл бұрын
Sir I have one dout..if I learn only core Java ..is ok for my placements
@maleeshasandakalum6213
@maleeshasandakalum6213
Thank you sir❤❤
@dhanvanthnarayanan7604
@dhanvanthnarayanan7604
The analogy you gave for the two functions - start() and run() is something I would tell even if you were to wake me up and ask in the middle of my sleep
@gilberthg3868
@gilberthg3868
So cool man, you explained the concept of the thread working in computer, while the other course don't. Really appreciate it! Thanks!
@taha7shaikh
@taha7shaikh Жыл бұрын
Thank you very very much, your way of explanation is really amazing
@vaishalis
@vaishalis
Excellently explained. Thank you so much
@abishekathangaselvam6673
@abishekathangaselvam6673
Excellent sir,u r really great many u tubes simply waste peoples time ,the time become precious or investment if spending on watching ur tutorials,no college tutors taught as how u r teaching hands up sir ❤❤❤
@nachiketnijap6990
@nachiketnijap6990
Man what the way of explaining ❤
@nikhee8
@nikhee8
waahh....brilliantly told
@sahanagowda9123
@sahanagowda9123 Жыл бұрын
Superb👏
@roshansreevastavroshansree6542
@roshansreevastavroshansree6542 Күн бұрын
00:03
@saqibullah7286
@saqibullah7286 Жыл бұрын
Love from Pakistan 🇵🇰🇮🇳
#87 Thread Priority and Sleep in Java
7:29
Telusko
Рет қаралды 70 М.
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27
How Many Balloons Does It Take To Fly?
00:18
MrBeast
Рет қаралды 41 МЛН
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 21 МЛН
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,1 МЛН
8 Design Patterns EVERY Developer Should Know
9:47
NeetCode
Рет қаралды 1 МЛН
#95 Comparator vs Comparable in Java
15:43
Telusko
Рет қаралды 153 М.
13.7 Multithreading Synchronized Keyword
10:17
Telusko
Рет қаралды 433 М.
#53 Packages in Java
12:20
Telusko
Рет қаралды 162 М.
Multithreading in Java Explained in 10 Minutes
10:01
Coding with John
Рет қаралды 891 М.
Java threads 🧵
16:01
Bro Code
Рет қаралды 107 М.
#40 Encapsulation in Java
11:42
Telusko
Рет қаралды 146 М.
#85 Threads in Java
5:13
Telusko
Рет қаралды 123 М.
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27