#86 Multiple Threads in Java
HTML-код
- Опубликовано: 9 фев 2025
- Check out our courses:
Java Full Stack and Spring AI - go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
DevOps with AWS: From Basics to Mastery : go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : go.telusko.com...
Coupon: TELUSKO20 (20% Discount)
For More Queries WhatsApp or Call on : +919008963671
Udemy Courses:
Spring: go.telusko.com...
Java:- go.telusko.com...
Java Spring:- go.telusko.com...
Java For Programmers:- go.telusko.com...
Python : go.telusko.com...
Git : go.telusko.com...
Docker : go.telusko.com...
website : courses.telusk...
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/nav...
Java:- bit.ly/JavaUde...
Spring:- bit.ly/SpringU...
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
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
holy smokes man , such a good explanation
keep up your good work sensei
arigato !!!
Every one searching thread app and I am searching thread in java😢😢
Development ✌️✌️🔥
what is a thread app?
Be happy about it 😄
😂
Me avoiding threads in insta and fb all the time😅😅
No one can explain better than this. True masterclass.
Indeed it is..😊
Sir, Excellent Explanation.. The way of explaining the concept is so clear. Thanks a lot..
00:03 Threads are often automatically created by frameworks in applications.
01:31 Two classes with different names and methods are created and objects are created to call the methods
02:52 Execution of show method causes a hold on the main method until it is done executing
04:19 Executing multiple behaviors simultaneously using threads.
05:54 Creating two new threads in Java
07:18 In Java, when using threads, the start method does not directly call the run method.
08:46 Parallel execution of code using multiple threads
10:13 Time-sharing scheduler allows executing multiple threads on a CPU with limited cores.
So cool man, you explained the concept of the thread working in computer, while the other course don't. Really appreciate it! Thanks!
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 ❤❤❤
Sir does all the misunderstandings and mistakes inside the tutorial so we don't need to do it and scratch our heads🙌🙌
Man what the way of explaining ❤
very well explained
good video...very clear in concept
Thank you very very much, your way of explanation is really amazing
Excellently explained. Thank you so much
Superb👏
thanks a lot Navinji
waahh....brilliantly told
Use while loop to execute
One of the best thumbs in youtube
What a video ❤
Good video 👍
Thank you sir❤❤
Love from Pakistan 🇵🇰🇮🇳
Sir can you please say about the singleton design patterns and creational patterns and behavioural and structural patterns sir you teaching so understandable please sir for me it's being so tuff to learn
Super 🎉
How do you get to see all the class details in vs code. Do we need to do something to see like that
please sir make the new video of Servlet and JSP tooo
2:59 haaa
❤❤❤
6:30
what happens when we call run() method instead of start() will it give same output
it will not create a thread, output will be 100 hi , and then 100 hello
Sir I have one dout..if I learn only core Java ..is ok for my placements
-> for on campus placements core java is enough for normal SDE role, but for java role core java is not enough you need to learn atleast springboot,
-> for off campus placements core java only it is not enough, need to learn spring, spring boot, must have projects on java.
Anna channel name telugu lo telusko ani pettaru explaination kooda telugulo chesthey chaalamandhi ki help idhi anna.............already pevious playlist english loney chesaaru.... ardhamcheskoni telugulo explaination isthaarani anukuntunnaam..... Exams kooda jaruguthunnaay kabatti chaala help avthundhi...Thank you
English lo chepthe chala mandiki use avuthundi bro terms kuda gurthuntai
Software industry loki vachaka English tappa vere dari undadhu bro...i think content is at its best
how is he able to get documentation of java in vs code
Hold the ctrl key and click.
If producer endpoint is slow itself then will threads benefits improving performance of consumer application?
println ke andar x: ye kya hai
Given by vs code to show the variable name.
Not part of the code
2365 threads? Are you sure about that?