14 Concurrency
Concurrency brings the power of parallelism to your applications. In this chapter, we’ll explore threading and asynchronous programming so you can unlock new levels of performance.
In this chapter, we’ll explore concurrency in Rust, starting with the basics of threads and how to manage ownership in a multithreaded context. The chapter covers various methods of thread communication, such as messages passing through channels and sharing states. Synchronization techniques, including barriers and scoped threads, are discussed to ensure safe concurrent operations. The chapter also introduces thread parking, async/await for asynchronous programming, and Tokio tasks for high-performance applications. Practical examples like web scraping ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access