Nice explanation on the new scoped threads. A little note on the static lifetime, as this is something that's not always clear to newcomers: A static lifetime doesn't mean "the value will life until the end of the program". It just means "the value must be able to live until the end of the program". This is normally fulfilled by either an actual static value, or an owned value. Since the owned value transfers ownership, it will live at least as long as the new scope. The value will still "die" (get dropped) when it gets out of scope at the end of the function. The lifetime is always necessary if you don't know when a given scope will end, like in the case of threads or async tasks. They *could* run until the end of the program, so the value must be able to live for the same amount of time. Unfortunately the compiler isn't able to detect when you join the thread, but that is exactly what the scoped threads try to fix (although it is still a bit more clunky)
Wow, I dismissed it initially when reading the changelogs for 1.63 and I appreciate you made a video to explain this, turns out to be very useful. Thanks a lot for putting this together.
I'm pretty new to rust (loving it though) and yet to write any multithreaded code but, wow does this make it look extremely easy and intuitive. Thanks for the video!
Nice explenation I like it a lot. Keep doing videos cause you are very good at explanint stuff. I might even register to one of your courses when gamedev will be released
I'm building my first multi-threaded program (a simple ray tracer) and I missed this update. I think this is perfect for my program, it'll let me remove a bunch of static lifetime annotations. Thanks so much for posting this.
You can think of lifetime as dependency, so, static lifetime basically means depending on a global/static variable, or even better, be an owner yourself, which depend on nothing. And for those 'a lifetime, it basically means the thing it depends on has a lifetime 'a. This is the mindset I have for dealing with lifetime constraints.
Nice explanation on the new scoped threads.
A little note on the static lifetime, as this is something that's not always clear to newcomers: A static lifetime doesn't mean "the value will life until the end of the program". It just means "the value must be able to live until the end of the program". This is normally fulfilled by either an actual static value, or an owned value. Since the owned value transfers ownership, it will live at least as long as the new scope. The value will still "die" (get dropped) when it gets out of scope at the end of the function. The lifetime is always necessary if you don't know when a given scope will end, like in the case of threads or async tasks. They *could* run until the end of the program, so the value must be able to live for the same amount of time.
Unfortunately the compiler isn't able to detect when you join the thread, but that is exactly what the scoped threads try to fix (although it is still a bit more clunky)
Wow, I dismissed it initially when reading the changelogs for 1.63 and I appreciate you made a video to explain this, turns out to be very useful. Thanks a lot for putting this together.
Beautiful explenation! Concise, yet explixative video. Thanks for sharing.
I'm pretty new to rust (loving it though) and yet to write any multithreaded code but, wow does this make it look extremely easy and intuitive. Thanks for the video!
Nice explenation I like it a lot. Keep doing videos cause you are very good at explanint stuff. I might even register to one of your courses when gamedev will be released
Someone check the subtitles, they occupy the whole screen at 0:00 and are turned on by default.
I'm building my first multi-threaded program (a simple ray tracer) and I missed this update. I think this is perfect for my program, it'll let me remove a bunch of static lifetime annotations. Thanks so much for posting this.
Thank you! you explained it in a clear and concise manner!
This is was super helpful, thank you!!
This is excellent!!! :3
This is an example of how to make nushell capture stdout & stderr, "do -i { git branch | complete }" in a folder that doesn't have a git repo.
You can think of lifetime as dependency, so, static lifetime basically means depending on a global/static variable, or even better, be an owner yourself, which depend on nothing. And for those 'a lifetime, it basically means the thing it depends on has a lifetime 'a. This is the mindset I have for dealing with lifetime constraints.
Awesome
love the video! Unrelated question: what theme are you using in your editor and terminal?
I use nightowl everywhere marketplace.visualstudio.com/items?itemName=sdras.night-owl
Are the closed captions scuffed for anyone else?
the generation for the captions was pretty bad in terms of grouping the words to time regions for this video and I didn't have the time to fix it yet.
Did he co back tho
Nice subtitles.
I've fixed them for future videos: th-cam.com/video/TEHZpp_IF3M/w-d-xo.html