4min chapter

 Rustacean Station  cover image

What's New in Rust 1.62, 1.63, and 1.64

Rustacean Station

CHAPTER

What Are Scoped Threads?

Scoped threads are something that used to exist in rust and then got removed in what's known as the leak apocalypse, which I think Ben has some context on. So scoped threads are essentially let's contrast them with regular threads. When you use the regular standard thread spawn function, you provide a closure and that closure has to be static. What that means is you're only allowed to give it references that live for the entirety of the program or give it ownership of anything that you move into the closure you pass to spawn. The reason why the API has to be a little bit weird like this is to actually guarantee that we can't pull shenanigans inside of the closures to make those references leak

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode