In this chapter, we're going to do a deep-dive on hopper, the grown-up version of Ring from Chapter 4, Sync and Send – the Foundation of Rust Concurrency. Hopper's approach to back-pressure—the weakness we identified in telem—is to block when filled to capacity, as SyncSender does. Hopper's special trick is that it pages out to disk. The hopper user defines how many bytes of in-memory space hopper is allowed to consume, like SyncSender, except in terms of bytes rather than total elements of T. Furthermore, the user is able to configure the number of on-disk bytes that are consumed when hopper's in-memory capacity is filled and it has to page out to disk. The other properties of MSPC are held, in-order ...
Locks – Mutex, Condvar, Barriers and RWLock
Get Hands-On Concurrency with Rust now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.