#86 Multiple Threads in Java

preview_player
Показать описание
Check out our courses:

Coupon: TELUSKO10 (10% Discount)

Coupon: TELUSKO10 (10% Discount)

Coupon: TELUSKO20 (20% Discount)

For More Queries WhatsApp or Call on : +919008963671

Udemy Courses:

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.

More Learning :

Donation:
PayPal Id : navinreddy20
Рекомендации по теме
Комментарии
Автор

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 !!!

dhanvanthnarayanan
Автор

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.

roshansreevastavroshansree
Автор

Every one searching thread app and I am searching thread in java😢😢

Mona-
Автор

Sir, Excellent Explanation.. The way of explaining the concept is so clear. Thanks a lot..

krishnamoorthysridhar
Автор

No one can explain better than this. True masterclass.

sathishbabu
Автор

So cool man, you explained the concept of the thread working in computer, while the other course don't. Really appreciate it! Thanks!

gilberthg
Автор

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 ❤❤❤

abishekathangaselvam
Автор

the best java playlist you can find on the internet

saurabhsharma
Автор

Sir does all the misunderstandings and mistakes inside the tutorial so we don't need to do it and scratch our heads🙌🙌

LV-nizu
Автор

Thanks sir made this thing so simple to understand while it felt something crazy while in college lectures.

ParthShahgg
Автор

How do you get to see all the class details in vs code. Do we need to do something to see like that

ragulparajuli
Автор

Excellently explained. Thank you so much

vaishali.r
Автор

Thank you very very much, your way of explanation is really amazing

tahashaikh
Автор

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

ChadRao
Автор

please sir make the new video of Servlet and JSP tooo

-ritikjain
Автор

Sir I have one dout..if I learn only core Java ..is ok for my placements

_HanuSaiR
Автор

If producer endpoint is slow itself then will threads benefits improving performance of consumer application?

letnaturespeak
Автор

what happens when we call run() method instead of start() will it give same output

nagarajukolar
Автор

Anna channel name telugu lo telusko ani pettaru explaination kooda telugulo chesthey chaalamandhi ki help idhi pevious playlist english loney chesaaru.... ardhamcheskoni telugulo explaination isthaarani Exams kooda jaruguthunnaay kabatti chaala help avthundhi...Thank you

Grow_with_Tech
Автор

how is he able to get documentation of java in vs code

manthanmoudgalya
visit shbcf.ru