My analogy after going through your video. Parallelism is like cars running on 4 different roads and concurrency is when those roads meet at an intersection how to manage traffic without accident using traffic light. Great video as always 👍🙏
Hi, what about this definitions, "Parallelism is about doing lot of independent things at once", and "Concurrency is about dealing with lot of dependent things at once", that is what I understood that according your explanation. :)
Parallelism is like cars running on 4 different roads and concurrency is when those roads meet at an intersection how to manage traffic without accident using traffic lights.
I checked lot of other tutorials. But the way you explained the things comparing with similar options alongside really helped a lot. This reduces confusion and gives clarity. Thanks brother 😊
Nice explanation, Just one suggestion it would be great if you could show the difference of both wrto definitions as a single slide it would be good to memorise. For example timestamps 1:32 & 6:51 can be shown next to each other in single slide to communicate the difference effectively
Thank you very much for making these concepts clear! This can definitely help many learners to continue or start learning these topics with a greater enthusiasm. Thanks again 👍🏻😊
My question is "which concept is used when we run the first program in a single-core machine?" As per my understanding (someone correct me if I am wrong): Concurrency is the idea of structuring a program in such a way that it can achieve parallelism when multiple cores are available. It is not about synchronization between threads. Parallelism is about execution and concurrency is about the structure. (Rob Pike). So in that sense, the structure of a multi-threaded application in any modern programming language follows a concurrency pattern. And this can achieve parallelism when multiple cores are available.
Agree about concurrency is about structure. But all programming languages require explicit use of tools (locks, threads, coroutines,async-await etc) to make it happen. Even on single-core machine, a thread waiting for IO can be bounced out and other thread allocated for efficiency (which speedens up the program).
@@DefogTech I totally agree with you on this. To create proper concurrent programs you need tools like mutex locks, routines, threads etc. All I am saying is that program in the first example is also of concurrency. The execution of it is an example of parallelism.
7:33 Concurrency is about dealing lot of things at once. Deal Concurrency 7:11. Parallelism is about doing lot of things at once. Enable Parrallelism 2:03 Concurrency is about dealing with a lot of things at once, but not necessarily doing them all at the same time. This means that a concurrent program can be run on a single-core processor, and the tasks will be interleaved. Parallelism, on the other hand, is about doing a lot of things at the same time. This means that a parallel program can only be run on a multi-core processor, and the tasks will be executed simultaneously.
Hi Deepak, Love you content, way of presentation and in-depth concept explanation. Was wondering if you have any repo created for all the code that you showcase as example in the sides. It would really help to grasp the concept even further. Keep up the good work.
Very nice explanation. I've a question here -- I'm just trying to understand how 'CompletableFeature' could be used to achieve concurrency ( i mean to say, in the context of inter leaving)
i have a confusion, sorry if this is vague... we can have threads > cores of cpu we can also have tasks > threads why do we need to support concurrency at both these levels? doesnt this lead to much more inefficiency due to context switching? like wouldnt it have been better if number of threads were = number of cores in cpu to support parallelism number of tasks > number of threads to support concurrency?
Thats what reactive programming helps with. It keeps number of threads constant (same as number of CPU cores). But the programming model becomes harder. Take example of web requests, if 1 thread operates on 1 request at a time you can have maximum 4 concurrent requests at a time, which is inefficent. If you want same thread to work on multiple requests then you have to handle the concurrency yourself making the code less straightforward. Thus the simpler way is more threads than cores.
@@DefogTech right! for some reason i thought that the fact that there are more tasks than threads it means there is concurrency there as well, which is not true. tasks just get queued up... and like you mentioned concurrency is achieved by more threads than cores!
this is AKA race condition in os we can use binary semaphore(mutex) to solve this problem which ensures that only one thread can run the piece of code at a time and block other threads in blocking queue.
Excellent, do u know O’Reilly? If u can make a total series of multi-threading courses, I’m going to subscribe to it! U r teaching style is really amazing! Fantastic!
In the given example of Parallelism all tasks are independent to each other , but what if they are depends on each other or if they are sharing some object... wouldn't it be similar to concurrency where threads couldn't be execute in parallel manner
My analogy after going through your video.
Parallelism is like cars running on 4 different roads and concurrency is when those roads meet at an intersection how to manage traffic without accident using traffic light.
Great video as always 👍🙏
Hi, what about this definitions, "Parallelism is about doing lot of independent things at once", and "Concurrency is about dealing with lot of dependent things at once", that is what I understood that according your explanation. :)
Best comment ever.
I would use "codependent" or "interdependent" instead of "dependent".
Parallelism is like cars running on 4 different roads and concurrency is when those roads meet at an intersection how to manage traffic without accident using traffic lights.
Possibly the best explanation of Concurrency & Parallelism I have ever listened to. Well done.
For me, it is the best tutorial for explaining concurrency and parallelism
One of the best-explained videos on concurrency, thanks!
Never seen a clearer explanation of this extremely tricky topic 🙏🙏🙏
never seen such explanation anywhere..it cleared my all doubts
It really helped me clear the confusion between parallelism and concurrency.
Awesome as usual, clear voice, simple explanation. Thank you :)
This (playlist) is best video tutorial on modern multithreading concept, Thanks :)
I checked lot of other tutorials. But the way you explained the things comparing with similar options alongside really helped a lot. This reduces confusion and gives clarity. Thanks brother 😊
You are simply amazing , I have really not seen such a clear explanation anywhere . God bless you dear brother.
This guy needs support you are superb. Keep uploading new videos
Nice explanation, Just one suggestion it would be great if you could show the difference of both wrto definitions as a single slide it would be good to memorise. For example timestamps 1:32 & 6:51 can be shown next to each other in single slide to communicate the difference effectively
Good point, thanks.. will note it for future videos
Mind Blowing Explanation
You are a great explainer
Thank you :)
@@DefogTech Thank you SSSSOOO MUCH SIR.. You have great QUALITY CONTENT! SALUTE TO YOUR EFFORTS!
Best explanation in entire internet. ;)
Clear core explanation is an outcome of you wonderful experience.
Thank you for making video.
best video I have ever seen on concurrency and parallelism, this has answered many of questions in my mind.Thanks a lot.
Any damn fool can make things look complex but it takes a genius to give it an easy touch . Great video !!
Good explanation in simple terms..thanks dude..
Thank you very much for making these concepts clear! This can definitely help many learners to continue or start learning these topics with a greater enthusiasm. Thanks again 👍🏻😊
Excellent! Easy to understand. Thanks for great video
I have no word to explain how much awesome you are!
Simply Awesome Demonstration.....!!!
👍🏼👍🏼👍🏼👍🏼👍🏼
Wonderfully explained. Thank you.
Simple and straightforward.....Thanks for this excellent video....
You're welcome :)
Excellent.. clear tone and explanation. Awesome voice
the way u explain, makes things look damn easy.....!!!!🙏
Thanks for th b video. Waiting for new videos!!
Good Explanation in simple words
My question is "which concept is used when we run the first program in a single-core machine?"
As per my understanding (someone correct me if I am wrong): Concurrency is the idea of structuring a program in such a way that it can achieve parallelism when multiple cores are available. It is not about synchronization between threads.
Parallelism is about execution and concurrency is about the structure. (Rob Pike).
So in that sense, the structure of a multi-threaded application in any modern programming language follows a concurrency pattern. And this can achieve parallelism when multiple cores are available.
Agree about concurrency is about structure. But all programming languages require explicit use of tools (locks, threads, coroutines,async-await etc) to make it happen. Even on single-core machine, a thread waiting for IO can be bounced out and other thread allocated for efficiency (which speedens up the program).
@@DefogTech I totally agree with you on this. To create proper concurrent programs you need tools like mutex locks, routines, threads etc.
All I am saying is that program in the first example is also of concurrency.
The execution of it is an example of parallelism.
All your videos are too good.
The way you explain is awesome. Animation is also very nice.
Thank you for your support Pramod! I am happy it helped
Very beautiful explanation, plz make more videos like this
Clear explanation.. keep it up bro..
Thanks for this video, very interesting
Best . Explanation . Ever!!
You got a new subscriber. What a explanation
Very helpful explanation, thanks a lot!
The final summary of the video was awesome and perfect :)
Good one , thanks for sharing
Easy,nice and practical examples.Superb job
Brilliantly explained :) Thanks a lot
Great content, your videos taking me into next level in concurrency concepts
Great explanation, thanks man.
Another great video. Thanks for uploading.
You're welcome!
Very Nice Explaination
The best explanation on the topic. Thank you so much!
Very well explained.
thank you very much, great tutorial
This was very great content. Thanks for sharing🙏
Very nice. Clear explanation.
Nice explanation. Thanx
Nice explaination.
Thank you so much for this great explanation.A long time confusion was cleared in this video.
You're very welcome sir!
Thanks Dude! You are genius!
Bro, you are excellent in your explanation and presentation.
Why don't you come up with videos on spring boot, everyone wants to learn
7:33 Concurrency is about dealing lot of things at once. Deal Concurrency 7:11. Parallelism is about doing lot of things at once. Enable Parrallelism 2:03
Concurrency is about dealing with a lot of things at once, but not necessarily doing them all at the same time. This means that a concurrent program can be run on a single-core processor, and the tasks will be interleaved.
Parallelism, on the other hand, is about doing a lot of things at the same time. This means that a parallel program can only be run on a multi-core processor, and the tasks will be executed simultaneously.
Wow!!! What a vivid explanation!!! Great work. You made hot topic to be more understandable and provided more information within a short span of time
Very good explanation
Very clear explanation. Thank you for creating video on this topics.
Great explanation
Awesome video.. thanks for sharing your knowledge
clear, explanations !!!!
Ha! AWESOME VID. I am just starting to learn concurrency for android. Got my sub
Very nice explanation. Thank you.
You're welcome!
Simple, clear (audio and video), content full video :-)
Thats nice... bro.
great playlist
Very Concise
Hi Deepak, Love you content, way of presentation and in-depth concept explanation. Was wondering if you have any repo created for all the code that you showcase as example in the sides. It would really help to grasp the concept even further. Keep up the good work.
Awesome 👌
Very nice explanation. I've a question here -- I'm just trying to understand how 'CompletableFeature' could be used to achieve concurrency ( i mean to say, in the context of inter leaving)
good one bro!!
precise explanation in simple words
Thanks you nice explanation
i have a confusion, sorry if this is vague...
we can have threads > cores of cpu
we can also have tasks > threads
why do we need to support concurrency at both these levels? doesnt this lead to much more inefficiency due to context switching?
like wouldnt it have been better if
number of threads were = number of cores in cpu to support parallelism
number of tasks > number of threads to support concurrency?
Thats what reactive programming helps with. It keeps number of threads constant (same as number of CPU cores). But the programming model becomes harder. Take example of web requests, if 1 thread operates on 1 request at a time you can have maximum 4 concurrent requests at a time, which is inefficent. If you want same thread to work on multiple requests then you have to handle the concurrency yourself making the code less straightforward. Thus the simpler way is more threads than cores.
@@DefogTech right!
for some reason i thought that the fact that there are more tasks than threads it means there is concurrency there as well, which is not true. tasks just get queued up...
and like you mentioned concurrency is achieved by more threads than cores!
super explanation. great thanks!
this is AKA race condition in os we can use binary semaphore(mutex) to solve this problem which ensures that only one thread can run the piece of code at a time and block other threads in blocking queue.
Awesome work ... all tut are great
Pleaae make video about various concurrency models
Excellent, do u know O’Reilly? If u can make a total series of multi-threading courses, I’m going to subscribe to it! U r teaching style is really amazing! Fantastic!
People like to bag on Indian RUclipsrs, but this guy knows his shit
Can you create video for system design like geo location based staff management and some custom frameworks.
In the given example of Parallelism all tasks are independent to each other , but what if they are depends on each other or if they are sharing some object... wouldn't it be similar to concurrency where threads couldn't be execute in parallel manner
Great Explanation
Super Great!!!!
Thank You so much
Great Explanation.
Can the lock be called inside the 2 thread functions? Instead of defining them outside the functions?
this is amazing!
Sir, instead of locks, cant we used synchronized modifier
Yes we can, anything that helps 2 threads to coordinate
Can you help me with a concurrency question.
Nice explanation which software you are using in your video for your notes
That's a normal PowerPoint slides
Nice one 👍🏼!
Thank you!
amazing explanation!
Thank you so much
please provide a tutorial about monitor in threads
Thank you.
well done! may I know what software did you use for recording this?
QuickTime (OSX)
kindly upload oracle related hard interview questions and DB schedulers
There is a playlist for interview questions on the channel.. can you please check if that helps