Тёмный
Will Tollefson
Will Tollefson
Will Tollefson
Подписаться
Hello! My name is Will Tollefson, and I'm a software engineer who enjoys learning and teaching others! I've been programming for over a decade now; the field of computer programming is continuously evolving, requiring even the most experienced programmers to acquire new skills. Whether its website design, artificial intelligence, or mobile app development, knowledge of computer programming opens the door to jobs in the tech sector, new hobbies, or impressing your grandma with your savvy computer skills! I've created this channel for beginning to expert programmers alike as a resource for learning and staying on the edge of programming.
Java Network Sockets + Virtual Threads = Cool!
26:54
5 месяцев назад
Operator Overloading in Kotlin
15:50
5 месяцев назад
Scoped Values in Java 22
18:38
5 месяцев назад
Structured Concurrency in Java 21
14:52
6 месяцев назад
The Abstract Factory Design Pattern In Java
12:22
7 месяцев назад
Kotlin Avoided a $1,000,000,000 Mistake
13:30
7 месяцев назад
Virtual Threads in Java 21
17:22
7 месяцев назад
The Factory Design Pattern In Java
10:49
8 месяцев назад
Getting Started With Kotlin: The Basics
16:41
8 месяцев назад
The Singleton Design Pattern In Java
15:21
8 месяцев назад
How to Create Your First Maven Java Project
12:37
8 месяцев назад
Coding a Java Sudoku Solver - Java Programming
21:13
10 месяцев назад
Java's Stream API Explained - Java Programming
16:54
11 месяцев назад
Комментарии
@audiomac
@audiomac 3 дня назад
Great into tutorial! However, I wish you went a little more into detail at the end. For instance, how do we find which threads the thread numbers are referring to? Also, how do we know which objects the threads are locked? You got answers like "0x2fc," but how do we find which variable that is referring to?
@willtollefson
@willtollefson 3 дня назад
Thanks for the question! The short answer is that the stack traces in the thread dump will usually tell you enough for a simpler example like this, but I do hear your point about more advanced debugging. In this particular example the trace tells you the line number its blocking on waiting for monitor entry and it tells which thread its waiting on. I've thought about making a video (or a series) on different debugging techniques with threading issues being a top contender. Is that something you'd like to see?
@audiomac
@audiomac 2 дня назад
@@willtollefson Yes; I would love a series about that. I have been studying computer science for two years now, but my textbook and classes never talked about the debugger. It's actually really embarrassing that I know nothing really about it😂😂
@willtollefson
@willtollefson 2 дня назад
@audiomac sounds good - I totally get it and I've heard that from a lot of folks. It seems like teaching debugging isn't always a priority which is odd to me since that's a decent portion of what devs do in industry. I'll see about putting out some more debugging videos in the future. Thanks!
@chaitustar372
@chaitustar372 5 дней назад
Why java is very complex. literally i don't understand anything 😥
@willtollefson
@willtollefson 4 дня назад
There are parts that are harder than others, yes. I found it helpful to take a higher level look at the stream API before taking a deeper dive into a component of it. If there’s anything I can help explain better, feel free to reply on this thread!
@JoLynch0
@JoLynch0 5 дней назад
So good man, well taught! Thank you!
@willtollefson
@willtollefson 5 дней назад
My pleasure!
@francisguchie1973
@francisguchie1973 12 дней назад
Wow this is detailed in a simplified way, and your speed is very very comfortable for me and very easy for a new bee to understand debugging
@willtollefson
@willtollefson 12 дней назад
Glad it was helpful!
@kaka_tutorails8765
@kaka_tutorails8765 15 дней назад
Excuses me sir. Can you make videos about JDK, JVM and JRE?
@willtollefson
@willtollefson 12 дней назад
Sure! Anything specifically you’d like to see?
@SurajVerma-k7k
@SurajVerma-k7k 15 дней назад
Hii Will, Thanks for making this video. I have a quick question here , it may seem little bit silly to you. why in 12:02 section of the video, we are trying to use a object instance of Thread class to call print status method. Pls explain if possible. and Thanks again!
@willtollefson
@willtollefson 15 дней назад
Thanks for the question! I glossed over that part in the video. The reason it’s doing that is because there needs to be a way to look at the status of the 1000 requests asynchronously and the way I implemented it was a status thread that starts executing after you construct the Server object. It could have instead been a getter that gets called periodically after the requests start submitting, but with the code as written if it weren’t done in a separate thread, the executor block would never be hit because the main class would have been blocked after Server constructor if that private method was called from in the constructor with the same thread. Hope this helps!
@WanderlustNoah
@WanderlustNoah 16 дней назад
Thanks!
@BlackbodyEconomics
@BlackbodyEconomics 17 дней назад
The only thing I actually care about is that you're using IntelliJ. You're already 12 light-years ahead of anybody using Eclipse.
@willtollefson
@willtollefson 16 дней назад
A while back I was a big eclipse user. The last 5 years or so IntelliJ has been my go to though. Hope you liked the video!
@kangshenggoh9128
@kangshenggoh9128 23 дня назад
can explain garbage collector
@willtollefson
@willtollefson 21 день назад
Do you want to know about how garbage collection works in Java in general, or specifically how it would pertain to something like a template expression?
@carloocarraro8829
@carloocarraro8829 28 дней назад
For the measure performance Instance + Duration. Good Video
@willtollefson
@willtollefson 28 дней назад
Thanks!
@Leukothea
@Leukothea 29 дней назад
THANK YOU!!! Your video helped me understand the difference between the two after a Udemy course failed doing so. Granted, I had to pause a few times and look up more stuff that I forgot already, but now ... 🤯 And as a lover of keyboard shortcuts, the sout > System.out.println() made me incredibly happy.
@sashar5646
@sashar5646 Месяц назад
Me at the start of this video: "Ah, how simple, I understand everything." After the 11th minute: "F-ck."
@willtollefson
@willtollefson Месяц назад
Threading issues and deadlocks can be some really interesting bugs to solve, which is why those thread dumps can be really useful!
@chukwumaohuabunwa
@chukwumaohuabunwa Месяц назад
Detailed explanation!! Subscribed already
@chukwumaohuabunwa
@chukwumaohuabunwa Месяц назад
For the reduce function, about what is happening. Is it (1001 + 1002 + ...) or (101 + 102 + ...) 12:32
@willtollefson
@willtollefson Месяц назад
Good catch - its supposed to be (101 + 102 + ...). I must have had the number "1000" in my head. Thanks for noting that!
@duparcg
@duparcg Месяц назад
filenotfound should really be unchecked because you have to run the code for it to see that the location is wrong for instance... very weird
@willtollefson
@willtollefson Месяц назад
A checked exception doesn’t necessarily mean an error can be detected at compile time or not (otherwise the compiler would just flag it right away). It just means that you have to provide explicit error handling code. Both checked and unchecked exceptions represent errors that can occur at runtime. The merits of checked exceptions are debatable, but among other checked exceptions, this one makes sense to me because there is reasonable likelihood of code hitting a case like this and you should have specific handling code available for it. Hopefully that helps clarify it a bit!
@duparcg
@duparcg Месяц назад
@@willtollefson thank you
@duparcg
@duparcg Месяц назад
great video
@gurdarshanbrar
@gurdarshanbrar Месяц назад
how do i keep playing again without quitting once started? i need to know for my assingment.
@willtollefson
@willtollefson Месяц назад
You can use another while loop to do that. For example if you want to keep the number range the same each time but select a different random number for each iteration, you could add a while loop around line 12.
@dipeshbisht8516
@dipeshbisht8516 Месяц назад
this needs more views. Great Explanation , thank you
@willtollefson
@willtollefson Месяц назад
Thanks so much!
@nikhilsinghal7542
@nikhilsinghal7542 Месяц назад
Thank you so much it helped a lot
@willtollefson
@willtollefson Месяц назад
You're welcome!
@ethanhunt937
@ethanhunt937 Месяц назад
Phenomenal
@ozgunkarzan5163
@ozgunkarzan5163 Месяц назад
Great explanation!
@willtollefson
@willtollefson Месяц назад
Glad to hear it!
@vamshikrishna1365
@vamshikrishna1365 Месяц назад
Really enjoyed this tutorial! Great job man!
@willtollefson
@willtollefson Месяц назад
Thank you!
@shalabhful
@shalabhful 2 месяца назад
Great content! one suggestion on positive side, sometime your voice is not very clear and feels like you are too tired.
@willtollefson
@willtollefson 2 месяца назад
Thanks for the comment and suggestion! Admittedly I sometimes do my filming late at night because there often aren’t enough hours in the day. I’ll do my best to get better at this 🙂
@AlFracoAl
@AlFracoAl 2 месяца назад
Its cool feature definatly I will use but there are people in my company who would revert my code and use jackson instead to create json Don't know how to deal with foolish people specially when the have power and evil intension against you
@willtollefson
@willtollefson 2 месяца назад
Sometimes adopting new ways of doing things takes time. In this situation they aren’t adding the feature in its current state to the language and will probably preview an updated version in a later JDK. Hopefully you can reason with the other folks at your company one way or the other. I’ve often found logical reasoning works well for programmers that program computer logic everyday 🙂
@AlFracoAl
@AlFracoAl 2 месяца назад
@@willtollefson Thanks but sometimes you find yourself in a place where stubbornness prevails over rationality and logical reasoning. But it good these days we have people like you who help others to stay up to date with their videos and other content
@rikikem5553
@rikikem5553 2 месяца назад
Brilliant tutorial !! Thanks to this video, I think I can aim for Java silver!
@vd-ösnd
@vd-ösnd 2 месяца назад
Thanks a lot ! The best simple explanation I found about how to start debugging in Java. Clear, concise, straight to the point!
@willtollefson
@willtollefson 2 месяца назад
Glad to hear you liked it! Debuggers can be very useful for sure
@NatiShen
@NatiShen 2 месяца назад
Are you planning on doing Spring tutorials in the future?
@willtollefson
@willtollefson 2 месяца назад
That depends. Do you want to see Spring tutorials? 🙂
@NatiShen
@NatiShen 2 месяца назад
@@willtollefson of course !!! There are no good ones online. You explain the best both for new programmers and more advanced.
@willtollefson
@willtollefson 2 месяца назад
I'll be sure to get to this when I can! I've been taking a short break recently while I have a very little one at home, but I hope to get back into a more regular posting schedule in the future!
@NatiShen
@NatiShen 2 месяца назад
@@willtollefson thanks a bunch
@abdullahkhaled6162
@abdullahkhaled6162 2 месяца назад
It will removed in the future releases :(
@willtollefson
@willtollefson 2 месяца назад
Yeah, it was a good concept, but unfortunately had some design flaws that they are working out now. Hopefully it will have a come back in another preview coming up
@armaulan
@armaulan 2 месяца назад
Great Tutorial ! Greeting from Indonesia
@willtollefson
@willtollefson 2 месяца назад
Greetings! Thanks for the comment 🙂
@vasylvch9320
@vasylvch9320 2 месяца назад
+++
@pontusschönhult
@pontusschönhult 2 месяца назад
can someone from another network join the chat with this method
@willtollefson
@willtollefson 2 месяца назад
If I’m understanding your question correctly, you would need to setup a public IP address with this method that is reachable to other networks and as long as you had network connectivity and the same socket protocol, you should generally be able to communicate.
@UmaVatsan
@UmaVatsan 2 месяца назад
Perfect !!!
@rajmaharjan5437
@rajmaharjan5437 2 месяца назад
I am so glad I found this channel!
@Egor_Phyl
@Egor_Phyl 2 месяца назад
Great explanation!
@Mat-qj4sg
@Mat-qj4sg 2 месяца назад
I don't usually write comments, but of all the videos about lambda I've watched, it was yours that made it clear to me. Thanks buddy, have a good day.
@willtollefson
@willtollefson 2 месяца назад
Awesome, glad to hear it!
@maaaciek5
@maaaciek5 29 дней назад
@@willtollefson Hey, I strongly agree with Mat. I don't write comments either, but finally now I understand lamdas... It's strange that you have so few viewers with such a great content. Thanks a lot!
@willtollefson
@willtollefson 28 дней назад
That’s great! Maybe over time I’ll get more views, but I’m not in any rush. I’m glad to hear that the content is helpful!
@lucap3741
@lucap3741 2 месяца назад
hey man really nice teeth
@willtollefson
@willtollefson 2 месяца назад
Thanks! When I see my dentist in a few months I'll be sure to thank him :)
@gagangupta1255
@gagangupta1255 2 месяца назад
Awesome tutorial
@willtollefson
@willtollefson 2 месяца назад
Thanks!
@titoluzuriaga8217
@titoluzuriaga8217 3 месяца назад
Great video. Regarding 9:45, because it's an object reference then it's not cached by the thread? Is it always reading from the heap (or L3 perhaps)?
@willtollefson
@willtollefson 3 месяца назад
Since its an object reference, the local variable value (e.g. the reference value) is cached, but the object data itself remains on the heap, so as long as you don't change the object reference, you'll still reference the same heap data across all of the threads. This is why its preferred to mark the object reference as immutable because that helps give you guarantees about the concurrent protection of the value. It doesn't, however, guarantee concurrent modification protection of the underlying object, which is why we're using AtomicInteger.
@titoluzuriaga8217
@titoluzuriaga8217 3 месяца назад
@@willtollefson thanks, I'm surprised because if I understand correctly then objects are always read from the heap and the cost is significantly higher.
@willtollefson
@willtollefson 3 месяца назад
Great point. The JLS (to my knowledge) doesn’t specify any sort of read optimizations in this type of situation. Something like that could probably be implemented per JVM if it can detect situations where a more efficient read can happen on an object reference (and I’m sure it does)
@NatiShen
@NatiShen 3 месяца назад
Hi will. Can you do an advanced video about threads, synchronised, volatil etc ?
@willtollefson
@willtollefson 3 месяца назад
Thanks for the comment! Here are some videos I've done on those topics: Volatile and atomic: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-31s_DzrkqZc.html Synchronized: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FpNRXz696ZY.html I've also done a few videos talking about runnables in general, virtual threads, and structured concurrency. If those don't scratch the itch, let me know and I can do a video on a specific threading topic.
@NatiShen
@NatiShen 2 месяца назад
​@@willtollefson Great videos.
@jorgemt9
@jorgemt9 3 месяца назад
Great video, explanation and easy to understand, keep up the good work 👍
@willtollefson
@willtollefson 3 месяца назад
Thanks!
@senorgriffin6405
@senorgriffin6405 3 месяца назад
you're awesome man, you should have way more suscribers and views
@willtollefson
@willtollefson 3 месяца назад
Thank you!
@ivanchl
@ivanchl 3 месяца назад
Amazing motto Never Stop Learning!
@willtollefson
@willtollefson 3 месяца назад
Thanks! It’s definitely something I try to follow almost every day
@user-nk6fq6dz6h
@user-nk6fq6dz6h 3 месяца назад
Thank you! Really simple it seems, haven't had to use one yet until now for my personal projects, and it seems like the Semaphores meet my needs easily. I was worried that I would've needed something more complex. Did you ever get around to making that lock video? I am going to be watching some of your other concurrency videos soon though to see what the other solutions look like.
@willtollefson
@willtollefson 3 месяца назад
That lock video is on my short list right now of future videos to make. There are multiple flavors of locks - if there's a particular thing you want me to cover in that video, let me know!
3 месяца назад
Great stuff man! I really find your explanations very useful. Thanks for sharing
@willtollefson
@willtollefson 3 месяца назад
You’re welcome, thanks for the comment!
3 месяца назад
Very good examples. Thank you very much for sharing
@willtollefson
@willtollefson 3 месяца назад
Glad you enjoyed it!
@Shuvooa
@Shuvooa 3 месяца назад
Please don't use `var`. It irritates the mind.
@willtollefson
@willtollefson 3 месяца назад
Personal preference I suppose 🙂 I know folks who use it every chance they get and others that wish it was never added to the language. What are your thoughts on it? I agree with a lot of what is stated here: openjdk.org/projects/amber/guides/lvti-style-guide
@ymetelkin
@ymetelkin 3 месяца назад
It takes 1.3 seconds on average to run 100,000 concurrent "1 second sleep" tasks in Go. This is 4 times faster than in your example. Is it expected? I didn't run Java version on my machine (I don't have it), but my laptop is not a super computer by any means. And just for the fun of it, I ran with 1M concurrent tasks and it took 3.1 seconds on average. And then, for even more fun, I ran it with 10M tasks; finally it was slower than 5 seconds, 11 seconds to be exact. I wonder if you can try your code with 1M tasks and share your results.
@willtollefson
@willtollefson 3 месяца назад
Thanks for the comment! When I run 1M tasks on my machine with the Java version, I'm getting 10-11 seconds. When I run similar Go code on my machine I'm getting around 5 seconds. Without deep diving the compiled byte code and go binary to really figure out the performance difference, I have a few upfront guesses: 1. Java warm up could be playing a small role here due to lazy initialization for things like the classloader and virtual threads mapping to platform threads 2. Java and Go have different default behavior for the number of routines that can be executed in parallel and the number of OS threads available to the runtime for scheduling. 3. Goroutines are optimized to have a small stack size at the beginning of execution and then expand as needed. I'm wondering if stack allocation for Java virtual threads is more expensive in this case. Both are still MUCH better in this example than the previous Java thread model though :)
@ymetelkin
@ymetelkin 3 месяца назад
Sleeping for 1 second is probably not a very realistic example and goroutine smaller starting stack may explain the difference