Java Memory Model in 10 minutes
Ғылым және технология
Java Memory Model is a set of rules all JVMs have to follow to ensure correct working of our concurrent programs.
More resources:
2016.javazone.no/program/the-...
shipilev.net/blog/2014/safe-p...
www.cs.umd.edu/~pugh/java/mem...
docs.oracle.com/javase/specs/...
Channel
----------------------------------
Complex concepts explained in short & simple manner. Topics include Java Concurrency, Spring Boot, Microservices, Distributed Systems etc. Feel free to ask any doubts in the comments. Also happy to take requests for new videos.
Subscribe or explore the channel - / defogtech
New video added every weekend.
Popular Videos
----------------------------------
What is an API Gateway - • What is an API Gateway?
Executor Service - • Java ExecutorService -...
Introduction to CompletableFuture - • Introduction to Comple...
Java Memory Model in 10 minutes - • Java Memory Model in 1...
Volatile vs Atomic - • Using volatile vs Atom...
What is Spring Webflux - • What is Spring Webflux...
Java Concurrency Interview question - • Java Concurrency Inter...
Пікірлер: 203
I'm going through this playlist to learn Java concurrency, and I have to say your explanation and presentation quality are amazing, and the diagrams are really helpful. thank you!
@DefogTech
4 жыл бұрын
Wow, thanks!
@mohammedrahamathulla4040
3 жыл бұрын
@@DefogTech Why no videos from you😔?? All your subscribers are waiting
Always read these topic therotically, but could never visualise it like this you have explained..Great presentation man!
I have never seen such an excellent explanation of JMM. Thanks a lot
I had an interview question like that.. This is a very clean explanation , keep doing it!
Your explanations are precise, but have so in-depth/hidden informations and moreover so easy to understand
Man, you are awesome. I was struggling trying to understand atomic operations and the use cases of volatile variables. Thank you so much
The best video i could find on youtube.
This helped me understand a lot about the JVM Thanks, you're very good at explaining things without any unneeded gibberish!
Very concise and easy to grasp. Great job!
I would absolutely recommend all Java engineers-whether junior or very senior-to watch this!
I tried multiple times myself to understand JMM, But this is the first time i got to learn something about them. Excellent Presentation. Hats of to you, You define perfection!!
@DefogTech
6 жыл бұрын
I am far from perfect. Though, thanks much for the kind words sir!
@yifei663
5 жыл бұрын
May be you should read java language specification : docs.oracle.com/javase/specs/jls/se8/html/jls-17.html .
You have a good teacher in you. Please continue the good work.
Awesome mate. You are really doing great, very impressive
Wow…. Such an well articulated video. I felt this topic to be very difficult to understand before I watched your video. Please sir keep adding more and more topics to this channel. For the first time fell in love with subject videos.
Awesome clarity. Voice is very clear and videos are well designed. Subscribed 👍
Crystal clear explaination... Loved it
You are my interview trainer...love you bro:)
Please make a whole course...I will definitely try buying it.Your videos are just awesome.
Honestly exceptionally well explained Sir, hats off
Really loved the explanation. Thank you
Best explanation of volatile so far... 👌
Best explanation I've seen, great work!
Very nicely explained. Please keep making such videos.👍👍
future me: volatile has semantics for memory visibility. Basically, the value of a volatile field becomes visible to all readers (other threads in particular) after a write operation completes on it. Without volatile, readers could see some non-updated value.
This playlist you have made is too awesome. your example/explanation for happens-before has a few issues. Not sure if I understood wrong, otherwise.Thank you so much for this playslit.
Thanks for sharing this concept. I had only some theoretical knowledge of this before I watch this imp video.
Hey great videos as always! I just wanted to ask, since primitives are passed by value and Objects are passed as reference, does the JVM only cache primitives into a threads local cache? If the value being updated was an Integer Object, e.g. new Integer(1), it would not need flushing as the object is passed by REFERENCE?
Amazing presentation. All the videos are really helpful. Great work.
My takeaway - if the tasks perform blocking IO operation, I should not use fork join pool. so true. Thanks for the explanation! You have a gift of mixing complicated concept easy to digest!
this channel deserve much more subscribers.
Awesome video...Please don't stop making such excellent videos.
@DefogTech
6 жыл бұрын
Thank you for the motivation sir!
@gurupadamgundala5142
5 жыл бұрын
Please make more videos
@ITech2005
5 жыл бұрын
Defog Tech More videos :)
@saravanprathi6956
3 жыл бұрын
More videos pleaseeeee
Great video, very clear explanation and examples. Thank you
U earned a fan today - Subscribed !
Best video on java on whole KZread universe
This is one ultimate video...subscribed !!
This video is pure GOLD!!!
Videos are very useful. Crisp & Clear. I request to make more videos
That was really good. Thanks for posting, excellent, clear and to the point presentation, good job!
@DefogTech
5 жыл бұрын
Thank you
everything to the point.. love ur videos bro❤️
Best explanations! Keep it up.
Bro You are simply amazing. You may be not realised how much you are helping us. Thank You bhai :D
Very nice explanation appreciate it, thanks.
Thanks for a proper explanation on happens-before 🙂
Jigger u r love... Awesome video.... Amazing teaching skills... Thanks a lot
Explanation is very good and sharp!
love your simple examples. thank you
Started watching thread pool videos Nd then addicted to all of ur videos Nd subscribed..the way of explanation is precise , innovative Nd interesting.your wrk deserves more than a thnks..
@DefogTech
5 жыл бұрын
Thank you for the kind words!! I am so happy its helping everyone
@sepraveen
4 жыл бұрын
Yes are techie by heart
Thank you for nice explanation and make more videos.
Awesome explanation and examples!
You are a fantastic teacher.. please please make more videos
Very good and simple explanation
Dude!! You are awesome, a true lifesaver. You are the first that have made it simple, at least that I have come across
@DefogTech
5 жыл бұрын
Thanks much buddy!
You're just brilliant! 🙏🏽
Learnt new information..thank you so much
I have been going through a lot of JAVA topic videos in different forums, by far Defog Tech is the best that I have come across. Advanced topics explained in a simple way which provides clarity. Keep going
@DefogTech
5 жыл бұрын
Thank you for the kind words sir!
Thank u, waiting for more videos on java
Awesome explanation buddy. thanks a lot. :)
Oh thanks man. I wish you were my lecturer 😀
Good explanation !! :) Very usefull
Excellent explanation. Thank you
🙏 You are the Best Teacher that I have ever seen.🥇, A classical method of approach = Superb indeed.👌.🎯Please Could you kindly teach us Flutter & Dart & Go lang & Scala too . Pleeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeese Sir..... 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏
2:50 loved this diagram man.
You are doing Great! Dude
This video is excellent.
Super explanation 👍
Hi, Thanks for the video. How is the volatile or synchronized or lock usage different from having the field in the constructor? Can't the shared cache object be used by putting the field in the constructor method and calling it in different threads?
Very good and crisp way of explanation. Keep doing this good :) work
@DefogTech
5 жыл бұрын
Thank you!
very simple to understand
Very good video, thank you!
Excellent explanation
Thank you very much sir!! You are amazing ❤️
Could you make a samples of reactive programming followed by your aka Java fiber videos. For eg, How to use RxJava for the below categories of apps, 1. Considering both frontend and backend 2. Considering there is no frontend and it's purely backend app. Doing good job. Really great👍
Amazing!!! You rock!
Very good content 😊
Great tutorial, thank you SIR!
@DefogTech
5 жыл бұрын
You're very welcome!
Awesome. Thanks man!
Awesome explanation mate. God bless you
Who the hell dislikes such a great videos??
@devendrawangikar2890
3 жыл бұрын
other video makers :)
Awesome dude... Helped a lot
@DefogTech
6 жыл бұрын
Glad it helped. Thank you!
Please do more such videos
Short and Sweet
good job, man!
Thank you! Really like your explanation.
@DefogTech
5 жыл бұрын
You're welcome! I'm happy you liked it
nice explanation
Awesome. Expected more videsos 👌👌👌
@DefogTech
5 жыл бұрын
Thank you sir!
In my case there is concurrent hashmap obj that holds configurations read from different server. Quartz scheduler will fetch configuration data for every 30 sec and update a new data (whole obj) to this concurrent hashmap.. In this case ,in my opinion voltaile should be used to always get the updated obj to the reader threads but some quality checking tools raising it as bug So any suggestions during this scenario
Your the best man 😀
2:10 each core has its own cache and then there are shared caches. Thread running on core changes the variable in its local cache only, volatile keyword makes sure variable is flushed to shared cache when thread changes it so that changes are visible to all the other threads 6:05 happens before relationship 9:30 volatile keyword example
@monstersmiled648
4 жыл бұрын
Hi can you help me I am confused when i was trying real time as per the diagram in the time 00:03:52 here i used this... System.out.println("the writerThread x is: "+x); System.out.println("the readerThread r2 is:"+r2); --------------------------------------------------------------------------------------------------------------------------------- like in this program(below): public class FieldVisibility { int x = 0; public void writerThread() { x = 1; System.out.println("the writerThread x is: "+x); } public void readerThread() { int r2 = x; System.out.println("the readerThread r2 is:"+x); } } output is:-- the writerThread x is: 1 the readerThread r2 is:1 ....................................................................................... instead of the writerThread x is: 1 the readerThread r2 is:0
Hi, I have one request if you could make a video on Performance improvement techniques. Not necessarily related to threading but in general. I am sure everyone would be benefited as you explain complex things in very simple way :)
@DefogTech
5 жыл бұрын
Sure, sounds like a good idea. Will add it to the list
Superb video
Explaination with L2 and L3 is so deep. How do you get so deep
read write barrier means what sir please explain if we use volatile what happens to those barriers
Really good explanation with a good visual display of those
Superb!
Great video
can you please make a video on working of JVM and its architecture? btw good job.
Awesome video... Can u also make video on design patterns ...?
Very clear video, though I would like suggest you to fix the code examples of locks or at least to have a disclaimer by voice that no one should use locks by your examples and should read a documentation instead which says you have to use "try { .. } finally { lock.unlock(); }" construct.
@DefogTech
5 жыл бұрын
Agreed. Will add a card to the video. Thanks!
Hi, Could you please make a video on memory management in java or provide a useful link for it. Thanks!!
Super video! I applauded for ₹40.00 👏