Тёмный

Java Network Sockets + Virtual Threads = Cool! 

Will Tollefson
Подписаться 2,3 тыс.
Просмотров 1,2 тыс.
50% 1

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@NatiShen
@NatiShen 5 месяцев назад
I was the one asking for this video, you have no idea how much I appreciate you right now. Your videos are some of the best out there when it comes to Java. I am sending your videos to everyone in my college.
@willtollefson
@willtollefson 5 месяцев назад
Glad you liked the video! Hopefully this is what you were looking for. Let me know if you have any other requests :)
@NatiShen
@NatiShen 4 месяца назад
Maybe you already have one but perhaps you could do a video on IO? I found it hard to figure out what's a buffered reader, why we insert another file reader inside, what's an output stream etc etc. Also, let's say I wanna learn a new api and it's structure. How would you do it ?
@willtollefson
@willtollefson 4 месяца назад
I did a high level video on file IO here a little while back: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Ldx3NdGk86o.html I don't go into a lot of detail on that video, but hopefully that touches on some of your questions. Learning a new API can be fun or frustrating depending on the documentation and examples available. I usually try to approach the API with a high level picture in mind of what its intended to do, and then I find the simplest example that accomplishes that. After I start learning the API's jargon, I'll play around with it some more and make sure I understand it, sometimes peaking at the source code if its available. In my experience following an example without context isn't super helpful, nor is diving head first into the documentation without looking at the bigger picture from time to time.
@brazenintellect364
@brazenintellect364 5 месяцев назад
This was an amazing walk through. Network programming in general is super interesting. I would really appreciate it if you cover the NIO way of socket programming.
@willtollefson
@willtollefson 5 месяцев назад
I think network programming is cool too. I’ll be sure to make a follow up video talking about NIO sockets as well. Thanks for the comment!
@willtollefson
@willtollefson 4 месяца назад
Here you go! ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-h76n2R4HRts.html
@brazenintellect364
@brazenintellect364 4 месяца назад
@@willtollefson Thank you so much🙌
@Michaelno
@Michaelno 5 месяцев назад
Coders who know networking are cool. 😎
@willtollefson
@willtollefson 5 месяцев назад
Haha definitely!
@DenaTollefson
@DenaTollefson 5 месяцев назад
Fantastic explanation of how networks in Java work, Will! Awesome socket programming tutorial 🤗
@willtollefson
@willtollefson 5 месяцев назад
Thank you!
@rahhi9792
@rahhi9792 5 месяцев назад
Appreciate you sharing this, Nice content. Next video on Websocket?
@willtollefson
@willtollefson 5 месяцев назад
Good idea on WebSocket. Are you looking for a video on the protocol, or the javax.websocket package and associated examples?
@rahhi9792
@rahhi9792 5 месяцев назад
@@willtollefson I am looking for example such as chat app or any other eg (serverbrowser). it would be great if you explain how this technology works.
@willtollefson
@willtollefson 5 месяцев назад
@@rahhi9792awesome - I’ll plan on making a video on that soon!
@구명수-h7c
@구명수-h7c 4 месяца назад
Hello, I'm watching your video in Korea :) But if you don't use NIO-socket for reading or writing, then isn't it essentially the same as using multi-platform threads? I'm a bit confused. Thank you for your nice video!
@willtollefson
@willtollefson 4 месяца назад
Thanks for the question! If the server has to spin off a thread per request (or thread per client), then you have two main options: 1. Platform threads (the original way) 2. Virtual threads In Java 21 and later, most of the time you'll want do option 2 due to how virtual threads are implemented. Most of the time you'll get a perceived performance boost because the JVM is more efficiently utilizing CPU resources across threads.
@devilhorrible6715
@devilhorrible6715 4 месяца назад
Are virtual threads being updated in the tomcat server?? If so, what is the version??
@willtollefson
@willtollefson 4 месяца назад
Yes, Tomcat is adding support for these! I haven't personally tried it, but the docs seem to indicate that virtual thread executors are avilable in Tomcat 11 at least, and there might be some support in Tomcat 10.
@devilhorrible6715
@devilhorrible6715 4 месяца назад
@@willtollefson Thanks for the update.
@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
Далее
Being Competent With Coding Is More Fun
11:13
Просмотров 78 тыс.
А вы играли в school boy runaway?
00:30
Просмотров 167 тыс.
Virtual Threads in Java 21
17:22
Просмотров 4,6 тыс.
Java 21 new feature: Virtual Threads #RoadTo21
33:35
Просмотров 64 тыс.
The Home Server I've Been Wanting
18:14
Просмотров 41 тыс.
18 Weird and Wonderful ways I use Docker
26:18
Просмотров 151 тыс.
Java's Virtual Threads - Next Steps
37:52
Просмотров 15 тыс.
Generics in C (Pool Allocator #2)
1:28:47
Просмотров 962
Java Virtual Threads
9:06
Просмотров 38 тыс.