Hi, I make videos about software development related topics like Java, web development etc. Occassionally I'll drop a video or two about career related issues too. Oh, I also run the tutorial website tutorials.jenkov.com .
I try to cover each topic in reasonable depth. My own experience has been, that the deeper my understanding of topics within software development is - the better and faster a developer I become.
I started programming around 1987 (around age 12) on the C128 - in C128 Basic - then on the Amiga 500 in AMOS and Assembler, then later PC and C. I started working with software as job from 1998 as web dev, and from 1999 as Java + web dev, so I've been in the game a long time :-)
From around 2000 and forward I have mostly been working as a freelance, onsite consultant with Java, web and distributed systems deelopment. I love being self employed - but it's a lot of work.
So you are saying that public void set(Values v) { synchronized (this) { this.a = v.a; this.b = v.b; this.c = v.c; } } nothing will be moved to be after ending of synchronised, but what about the following public void set(Values v) { this.c = v.c; synchronized (this) { this.a = v.a; this.b = v.b; } } What if this happens? This can be a potential issue
I don't think anything before the end of a synchronized block can be moved to after the end of a synchronized block. But, it's better to be safe than sorry, so move it inside the block if you are uncertain.
You tried so hard to be clear but you failed and even in the comments you are sticking to it. People are asking, do you mean CPU or CPU core. It matters!!! Stop saying it doesn't. The average person does NOT have a multi CPU machine. So it matters. By not CLEARLY defining what you mean, it causes more confusion, especially to those trying to learn the VERY difficult concept. Say what you mean, say CPU Core. It means something.
Allright - I will say CPU core in the future... I don't personally think it makes a big difference, except a bit about the internal design with caches etc. But I can refer to the cores as "cores" ... We are also getting a GPU API in Java in the future, and I guess we also just call it "one GPU with many cores".
@@JakobJenkov I appreciate your response. I really liked your video but I did have to look at a couple more to fully understand that you meant CPU core. Thank you for taking the time and being willing to adapt. As a consumer of content, I can only appreciate those who are willing to accept feedback and adapt. Thank you for your response.
For a moment I thought ThreadPool was a Java standard class and wondered how I could miss this? Thank God. It's a custom one made by the author. No need to remember that. This should have been made it clear in the beginning.
@JakobJenkov, thanks for the set of videos. Can you please provide more details about why the PoolThreadRunnable.doStop() and PoolThreadRunnable.isStopped() are synchronized? I am not sure I understand the purpose of this, as both are called from the synchronized methods of the ThreadPool instance.
Issue is with this.queue.offer(task); inside execute() method. We need to wait before there is some space in the queue for adding more items. or using overloaded this.queue.offer(task, 100, TimeUnit.SECONDS); let me know if you think there is some other issue.
I'm really impressed with that great explanation and the way you simplify things with the graphs and code samples! Thank you for putting all that effort! BTW IF You Didn't Have a Profile Picture I Would Have thought This is LORD BEALISH speaking😂
:-D ... Lord Baelish :-D ... well, not quite ;-) ... more like Ragnar Lodbrok ;-) :-D (... as I am Danish too ;-) ). Thank you for your kind words about the video! :-)
Great tutorial about multithreading and Java memory model, but one thing is missing. Diagrams are too static, when you explain different variants of code you should follow that and draw on diagram what is happening, because it will be more clearer. For example in section with local variables and object locations, for different combinations in code you are always using same diagram, so it is very confusing to realize what and which objects are created. This is just feedback from my side how to improve you tutorials
Thanks for the feedback ! I will try to think about that in future videos! :-) It's not always so easy to draw clearly the ideas I am trying to convey :-) But I will try to think more about it!
Coming here after finishing the concurrency playlist because of your excellent content. Your content is criminally underrated. Should have more likes and views. Nevertheless, thank you for investing your time into this.
Thank you very much for your kind words! :-) I try to focus on being happy about the views they do get - and the people that find something useful in my videos :-) What "could have been" is imaginative. What "is" - is what I focus on :-)
Hi Jakob, great content as usual but i am adding a small suggestion that you should've explained about other implementations of Lock interface and how many locks are there in java etc.
20:09 Spurious wake-ups are not because of any bug, but because of the underlying OS synchronization system (futex-es on Linux OSes, for example). Wikipedia has an article on "Spurious Wakeup" for anyone interested in this problem.
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns...Thanks a Lot form 10+ yrs exp guy from BLR,India.
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns...Thanks a Lot form 10+ yrs exp guy from BLR,India.
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns.........Thanks a Lot form 10+ yrs exp guy from BLR,India.
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns.......Thanks a Lot form 10+ yrs exp guy from BLR,India.
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns.....Thanks a Lot form 10+ yrs exp guy from BLR,India.
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns.....Thanks a Lot form 10+ yrs exp guy from BLR,India.
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns.......Thanks a Lot form 10+ yrs exp guy from BLR,India.
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns.......Thanks a Lot form 10+ yrs exp guy from BLR,India.
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns.......Thanks a Lot form 10+ yrs exp guy from BLR,India.
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns...Thanks a Lot form 10+ yrs exp guy from BLR,India.
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns....Thanks a Lot form 10+ yrs exp guy from BLR,India.
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns..Thanks a Lot form 10+ yrs exp guy from BLR,India..
God of Concurency..i have bene flowing you since my 2014 when you used to write blog post only...by going through your post i attend interview like a LION when they ask mutithreading qns..Thanks a Lot form 10+ yrs exp guy from BLR,India.
Hi Jacob, Great explanation really appreciate and you just got a sub 🙂 Below are two points i need to ask:- 1) The main method itself runs in a thread so the threads defined are its local variables right? 2) You said object references are stored on stack and objects on heap but what if variable is a primitive type that is they are not objects.
Yes, the local variables in main() are local to the thread running main() Primitives don't have object references to them. The primitive values are store on the stack directly.
My understanding is: Java threads are all user-level, and there is no need to trap to OS level for context switching. But what you said about Synchronized relies on JVM or OS to keep synchronization. I don’t quite understand the part about (implementation of) Synchronized. Can you recommend some reading materials or make a series of videos to explain JVM in depth?
Jakob you deserve more exposure and subscriber. Your materials and lectures are very organized and structured!!! You taught way better than UC professor!