Others: There are two ways to create thread. Extending Thread class or implementing Runnable interface. Telusko: We implement Runnable interface because of inability of multiple inheritance. Great Tutorials..
Thanks, Telusko, very clear explanation, those individuals are creating networking tutorials should adopt your simple method of explanation, Instead, they are being around the bush or explanation is not clear.
Hi Sir, I am facing problem to understand concurrent API, it would be great if you publish one video on this. Thank you very much for earlier videos. Thanks, Rahul S
Hi naveen, I used to follow your videos from long back. I learnt a lot from your videos honestly. Thank you for your contributions to the developer community. At 3:36 - I want to correct one thing. M̶u̶l̶t̶i̶t̶h̶r̶e̶a̶d̶i̶n̶g̶ ̶w̶o̶r̶k̶s̶ ̶u̶s̶i̶n̶g̶ ̶o̶n̶l̶y̶ ̶o̶n̶e̶ ̶c̶o̶r̶e̶ ̶i̶.̶e̶.̶ ̶w̶h̶e̶n̶ ̶a̶ ̶j̶a̶v̶a̶ ̶p̶r̶o̶g̶r̶a̶m̶ ̶r̶u̶n̶s̶ ̶i̶t̶ ̶c̶r̶e̶a̶t̶e̶s̶ ̶a̶ ̶p̶r̶o̶c̶e̶s̶s̶ ̶a̶n̶d̶ ̶t̶h̶e̶ ̶t̶h̶r̶e̶a̶d̶s̶ ̶w̶e̶ ̶c̶r̶e̶a̶t̶e̶ ̶i̶n̶s̶i̶d̶e̶ ̶t̶h̶e̶ ̶p̶r̶o̶g̶r̶a̶m̶ ̶w̶i̶l̶l̶ ̶b̶e̶ ̶t̶h̶r̶e̶a̶d̶s̶ ̶i̶n̶s̶i̶d̶e̶ ̶t̶h̶a̶t̶ ̶p̶r̶o̶c̶e̶s̶s̶.̶ ̶M̶u̶l̶t̶i̶p̶r̶o̶c̶e̶s̶s̶i̶n̶g̶ ̶o̶r̶ ̶p̶a̶r̶a̶l̶l̶e̶l̶i̶s̶m̶ ̶i̶s̶ ̶w̶h̶a̶t̶ ̶y̶o̶u̶ ̶e̶x̶p̶l̶a̶i̶n̶e̶d̶ ̶i̶.̶e̶.̶ ̶d̶o̶i̶n̶g̶ ̶m̶u̶l̶t̶i̶p̶l̶e̶ ̶t̶h̶i̶n̶g̶s̶ ̶a̶t̶ ̶o̶n̶c̶e̶ ̶b̶y̶ ̶u̶s̶i̶n̶g̶ ̶m̶u̶l̶t̶i̶p̶l̶e̶ ̶c̶o̶r̶e̶s̶ ̶i̶n̶ ̶t̶h̶e̶ ̶m̶a̶c̶h̶i̶n̶e̶.̶ Multithreading in the single-core machine works by context switching quickly whereas in a multi-core machine threads run in multiple cores. P̶l̶e̶a̶s̶e̶ ̶p̶i̶n̶ ̶t̶h̶i̶s̶ ̶c̶o̶m̶m̶e̶n̶t̶ ̶o̶r̶ ̶e̶d̶i̶t̶ ̶t̶h̶e̶ ̶v̶i̶d̶e̶o̶.̶ ̶P̶e̶o̶p̶l̶e̶ ̶m̶a̶y̶ ̶m̶i̶s̶u̶n̶d̶e̶r̶s̶t̶a̶n̶d̶ ̶t̶h̶e̶ ̶c̶o̶n̶c̶e̶p̶t̶.̶
Yes, that is true in the case when there is only one CPU with a single core, but Modern computers, though, come with multi-core CPUs, and even with multiple CPUs too. This means that separate threads can be executed by separate cores or CPUs simultaneously.
@Lokesh, heard about context-switching ?, its perceived vs. actual concurrency. In multi-processor system , multiple threads execute , simultaneously on different cores. Eg- If there are two threads and two cores , then each thread would run on individual core. In a single-processor system, multiple threads execute , one after the other or wait until one thread finishes or is preempted by the OS , depending on the thread priority and the OS policy.But the running threads , gives an illusion that they run simultaneous
No you misunderstood the concept yourself instead of going to wikipedia where anyone can edit any article this is from oracle (Read carefully until the end on how threads run in a multiprocessor environment , nothing of what he said is wrong ) : In a multithreaded process on a single processor, the processor can switch execution resources between threads, resulting in concurrent execution. Concurrency indicates that more than one thread is making progress, but the threads are not actually running simultaneously. The switching between threads happens quickly enough that the threads might appear to run simultaneously. In the same multithreaded process in a shared-memory multiprocessor environment, each thread in the process can run concurrently on a separate processor, resulting in parallel execution, which is true simultaneous execution. When the number of threads in a process is less than or equal to the number of processors available, the operating system's thread support system ensures that each thread runs on a different processor. For example, in a matrix multiplication that is programmed with four threads, and runs on a system that has two dual-core processors, each software thread can run simultaneously on the four processor cores to compute a row of the result at the same time.
@Jo Victor - you’re elaborating the same thing i said… i just didn’t mention that the processor context switches between multiple threads but the gist is same… concurrency is managing multiple tasks whereas parallelism is doing multiple tasks at the same time
@Tulusko: Runnable is not the way to create a thread! Infact it's just a job which can be assigned to run in any thread. Please correct this in your video.
Suppose i have 9 threads in a octacore machine, then 2 threads should overlap or use the same core for processing if they are running parallely; how does this happen? Can you make a video on this or suggest some links? The video was great btw.
Multiprocessing uses two or more CPUs to increase computing power, whereas multithreading uses a single process with multiple threads to increase computing power. Multithreading focuses on generating computing threads from a single process, whereas multiprocessing increases computing power by adding CPUs.
There is no direct relationship between multi-threading and multiple CPU cores. Even a single core CPU can handle multiple threads( as spell-check feature in ms word was there even before dual core CPUs came). Multi-threading is more about utilizing the CPU-cycle of one core.
The most underrated tutor of all time for all ages...
Yes for brokers he is
But for students he is god dev ❤
Thank you sir for your classes
Even after 10 years also,your videos will help many engineering students.🤗❤️
Others: There are two ways to create thread. Extending Thread class or implementing Runnable interface.
Telusko: We implement Runnable interface because of inability of multiple inheritance.
Great Tutorials..
Super bro ❤
u r getting better and better than better
Best Threading explaination from youtube
The counterstrike part was awesome !!!
Sir, you have changed incredibly in last 5 years.
Hello from Istanbul,Turkey.Brother Navin,you are really good at teaching.Thank you so much for your great effort and stuffs.
i will donate to Telusko in my working life.....
it helped me a lot,
Thank you sir.
Best teacher ever I seen on RUclips
Hi sir u r my hero...u gave technology life to me
This video is amazing. It gives a clear concept of MultiThreading.
I don't understand
Directly he is going into program
First time I am seeing your video .Really well explained and useful .Concepts are explained crystal clear
Hello
i am coming here from his python tutorial to java done with python
great explanation
thankyou very much sir
Thanks, Telusko, very clear explanation, those individuals are creating networking tutorials should adopt your simple method of explanation, Instead, they are being around the bush or explanation is not clear.
Good explanation sir
The effort you make us to understand any concept is really really good , thanks a lot sir ! 🙂
Thank you sir...you made me java Concepts understand much more easier
Excellent video.
Michael Knox i agree. Big thanks to the teacher!
Thank you, Eve
pariiii
Thank you from tamilnadu
Thank you very much for all your videos
U r teaching is very interesting
Great explaination sir
Thanks for the paylist !!!
As always - wonderful !!!
things getting interesting to know more about threads
This is really amazing. The way you explain concepts. Thanx.
explained wonderfully... Thanks
I really love you Bhai you are my favorite teacher...😍😍❣️❣️❣️❣️❣️
Thanks for this wonderful video. May gbu with lots of success love and life. Keep Rocking
good explanation about usage of multithreading
Very good explanation thanks Sir
U r great job sir 🙏🙏🙋
thanks man your ways of explanation is amazing
Hi Sir,
I am facing problem to understand concurrent API, it would be great if you publish one video on this.
Thank you very much for earlier videos.
Thanks,
Rahul S
ok
Lol
Thank you sir😁
BEst learning channel in youtube Telusko and Mysirg
Great video sir.
I learned lot from ur videos..thank you very much sir
Thank you very much Brother
Awesome video man!!
thanku sir for delivering lecture in so simple way
just awesome
very well explained
Good video. Nicely explained.
Thank you very much
Explained so clearly!
Thank you
Was looking so long for this and im really thankful for this help. LIKE
Great explanation.
Hi naveen, I used to follow your videos from long back. I learnt a lot from your videos honestly. Thank you for your contributions to the developer community. At 3:36 - I want to correct one thing. M̶u̶l̶t̶i̶t̶h̶r̶e̶a̶d̶i̶n̶g̶ ̶w̶o̶r̶k̶s̶ ̶u̶s̶i̶n̶g̶ ̶o̶n̶l̶y̶ ̶o̶n̶e̶ ̶c̶o̶r̶e̶ ̶i̶.̶e̶.̶ ̶w̶h̶e̶n̶ ̶a̶ ̶j̶a̶v̶a̶ ̶p̶r̶o̶g̶r̶a̶m̶ ̶r̶u̶n̶s̶ ̶i̶t̶ ̶c̶r̶e̶a̶t̶e̶s̶ ̶a̶ ̶p̶r̶o̶c̶e̶s̶s̶ ̶a̶n̶d̶ ̶t̶h̶e̶ ̶t̶h̶r̶e̶a̶d̶s̶ ̶w̶e̶ ̶c̶r̶e̶a̶t̶e̶ ̶i̶n̶s̶i̶d̶e̶ ̶t̶h̶e̶ ̶p̶r̶o̶g̶r̶a̶m̶ ̶w̶i̶l̶l̶ ̶b̶e̶ ̶t̶h̶r̶e̶a̶d̶s̶ ̶i̶n̶s̶i̶d̶e̶ ̶t̶h̶a̶t̶ ̶p̶r̶o̶c̶e̶s̶s̶.̶ ̶M̶u̶l̶t̶i̶p̶r̶o̶c̶e̶s̶s̶i̶n̶g̶ ̶o̶r̶ ̶p̶a̶r̶a̶l̶l̶e̶l̶i̶s̶m̶ ̶i̶s̶ ̶w̶h̶a̶t̶ ̶y̶o̶u̶ ̶e̶x̶p̶l̶a̶i̶n̶e̶d̶ ̶i̶.̶e̶.̶ ̶d̶o̶i̶n̶g̶ ̶m̶u̶l̶t̶i̶p̶l̶e̶ ̶t̶h̶i̶n̶g̶s̶ ̶a̶t̶ ̶o̶n̶c̶e̶ ̶b̶y̶ ̶u̶s̶i̶n̶g̶ ̶m̶u̶l̶t̶i̶p̶l̶e̶ ̶c̶o̶r̶e̶s̶ ̶i̶n̶ ̶t̶h̶e̶ ̶m̶a̶c̶h̶i̶n̶e̶.̶
Multithreading in the single-core machine works by context switching quickly whereas in a multi-core machine threads run in multiple cores.
P̶l̶e̶a̶s̶e̶ ̶p̶i̶n̶ ̶t̶h̶i̶s̶ ̶c̶o̶m̶m̶e̶n̶t̶ ̶o̶r̶ ̶e̶d̶i̶t̶ ̶t̶h̶e̶ ̶v̶i̶d̶e̶o̶.̶ ̶P̶e̶o̶p̶l̶e̶ ̶m̶a̶y̶ ̶m̶i̶s̶u̶n̶d̶e̶r̶s̶t̶a̶n̶d̶ ̶t̶h̶e̶ ̶c̶o̶n̶c̶e̶p̶t̶.̶
Yes, that is true in the case when there is only one CPU with a single core, but Modern computers, though, come with multi-core CPUs, and even with multiple CPUs too. This means that separate threads can be executed by separate cores or CPUs simultaneously.
Yup
@Lokesh, heard about context-switching ?, its perceived vs. actual concurrency.
In multi-processor system , multiple threads execute , simultaneously on different cores. Eg- If there are two threads and two cores , then each thread would run on individual core.
In a single-processor system, multiple threads execute , one after the other or wait until one thread finishes or is preempted by the OS , depending on the thread priority and the OS policy.But the running threads , gives an illusion that they run simultaneous
No you misunderstood the concept yourself instead of going to wikipedia where anyone can edit any article this is from oracle (Read carefully until the end on how threads run in a multiprocessor environment , nothing of what he said is wrong ) : In a multithreaded process on a single processor, the processor can switch execution resources between threads, resulting in concurrent execution. Concurrency indicates that more than one thread is making progress, but the threads are not actually running simultaneously. The switching between threads happens quickly enough that the threads might appear to run simultaneously.
In the same multithreaded process in a shared-memory multiprocessor environment, each thread in the process can run concurrently on a separate processor, resulting in parallel execution, which is true simultaneous execution. When the number of threads in a process is less than or equal to the number of processors available, the operating system's thread support system ensures that each thread runs on a different processor. For example, in a matrix multiplication that is programmed with four threads, and runs on a system that has two dual-core processors, each software thread can run simultaneously on the four processor cores to compute a row of the result at the same time.
@Jo Victor - you’re elaborating the same thing i said… i just didn’t mention that the processor context switches between multiple threads but the gist is same… concurrency is managing multiple tasks whereas parallelism is doing multiple tasks at the same time
Amazing class ,thank you sir
I find your video very useful for primers.. i have listened your API, JSON,Bubble Sort previously.. and now multithreading! keep up the good work!
You are really good
Thank You Navin Sir , in less time I get to learn a concept fast ....all credit to your teaching.
Sir plz make video for swings components
Nice videos 👌👌
Well explained.
Explained well
Really Nice video
Amazingly explained 🤝🏻
sir,please upload a video on creating multiple threads with step by step explanation of execution of all threads...
good bro. Thank you.
@Tulusko: Runnable is not the way to create a thread! Infact it's just a job which can be assigned to run in any thread. Please correct this in your video.
thank you sir
Cool sir
Super Class
sir, please make an video of applet in java
simply Best
nice edited pooja
Very clear explanation, very useful video. Thanks Telusko !
Can you upload a video explaining synchronization in multi threading?
Now it is available in this channel.
Helpful
Helped me a lot. Thanks for sharing
good video
Theoretical explanation is also too good Sir..keep going Sir
welcome back aliens👽
Amazing
Nice Video !
Thanks a ton!
Suppose i have 9 threads in a octacore machine, then 2 threads should overlap or use the same core for processing if they are running parallely; how does this happen? Can you make a video on this or suggest some links? The video was great btw.
in single core also multithreading can achieve , There are concept of context switching
Thank you sir.
Sir,please upload a video on synchronization concept from multithreading in JAVA...
Tq sir.
ausm work sir
Amazing !! Thank you, sir.
Thank you so much! This helped a lot.
My God, you are so intelligent!
Thank you, this was really informative!
how to solve it sir and please help for solving
a. Design and implement the application using sequential
Amazing video!!! Thank you sir, so much!!!
What is the diff between multiprocessing and multithreading?
Multiprocessing uses two or more CPUs to increase computing power, whereas multithreading uses a single process with multiple threads to increase computing power. Multithreading focuses on generating computing threads from a single process, whereas multiprocessing increases computing power by adding CPUs.
Good
Thank you sir, you're a legend! 😁
sir please give brief note on this topic in the video description
Sir multithreading exposure mean?
nice,,,carry on
There is no direct relationship between multi-threading and multiple CPU cores. Even a single core CPU can handle multiple threads( as spell-check feature in ms word was there even before dual core CPUs came).
Multi-threading is more about utilizing the CPU-cycle of one core.
Exactly sir...
thnku sir
Nice!
good video ty!