2 options
Hands-on concurrency with Rust : confidently build memory-safe, parallel, and efficient software in Rust / Brian L. Troutwine.
- Format:
- Book
- Author/Creator:
- Troutwine, Brian L., author.
- Language:
- English
- Subjects (All):
- Application software--Development.
- Application software.
- Computer multitasking.
- Programming languages (Electronic computers).
- Physical Description:
- 1 online resource (1 volume) : illustrations
- Edition:
- 1st ed.
- Place of Publication:
- Birmingham, UK : Packt Publishing, 2018.
- Biography/History:
- L. Troutwine Brian: Brian L. Troutwine is a software engineer with an interest in low-latency and high-scale software. He has worked at Rackspace Hosting, AdRoll, and Postmates. As his first book publishes, he will be starting at Unity Technologies. He has delivered the following talks: The Charming Genius of the Apollo Guidance Computer Getting Uphill on a Candle: Crushed Spines, Detached Retinas, and One Small Step 10 Billion a Day, 100 Milliseconds Per: Monitoring Real-Time Bidding at AdRoll Fetching Moths from the Works: Correctness Methods in Software Build Good Software: Of Politics and Method
- Summary:
- Writing safe and correct parallel programs is tough. Reasoning about concurrent memory modification is tough; efficiently exploiting the modern computing environment (with its multi-layered caches and deep execution pipelines) is also tough. Most systems programming languages add a further complication: unsafe memory access. The burden on you,.
- Contents:
- Cover
- Title Page
- Copyright and Credits
- Dedication
- Packt Upsell
- Contributors
- Table of Contents
- Preface
- Chapter 1: Preliminaries - Machine Architecture and Getting Started with Rust
- Technical requirements
- The machine
- The CPU
- Memory and caches
- Memory model
- Getting set up
- The interesting part
- Debugging Rust programs
- Summary
- Further reading
- Chapter 2: Sequential Rust Performance and Testing
- Diminishing returns
- Performance
- Standard library HashMap
- Naive HashMap
- Testing with QuickCheck
- Testing with American Fuzzy Lop
- Performance testing with Criterion
- Inspecting with the Valgrind Suite
- Inspecting with Linux perf
- A better naive HashMap
- Chapter 3: The Rust Memory Model - Ownership, References and Manipulation
- Memory layout
- Pointers to memory
- Allocating and deallocating memory
- The size of a type
- Static and dynamic dispatch
- Zero sized types
- Boxed types
- Custom allocators
- Implementations
- Option
- Cell and RefCell
- Rc
- Vec
- Chapter 4: Sync and Send - the Foundation of Rust Concurrency
- Sync and Send
- Racing threads
- The flaw of the Ring
- Getting back to safety
- Safety by exclusion
- Using MPSC
- A telemetry server
- Chapter 5: Locks - Mutex, Condvar, Barriers and RWLock
- Read many, write exclusive locks - RwLock
- Blocking until conditions change - condvar
- Blocking until the gang's all here - barrier
- More mutexes, condvars, and friends in action
- The rocket preparation problem
- The rope bridge problem
- Hopper-an MPSC specialization
- The problem
- Hopper in use
- A conceptual view of hopper
- The deque.
- The Receiver
- The Sender
- Testing concurrent data structures
- QuickCheck and loops
- Searching for crashes with AFL
- Benchmarking
- Chapter 6: Atomics - the Primitives of Synchronization
- Linearizability
- Memory ordering - happens-before and synchronizes-with
- Ordering::Relaxed
- Ordering::Acquire
- Ordering::Release
- Ordering::AcqRel
- Ordering::SeqCst
- Building synchronization
- Mutexes
- Compare and set mutex
- An incorrect atomic queue
- Options to correct the incorrect queue
- Semaphore
- Binary semaphore, or, a less wasteful mutex
- Chapter 7: Atomics - Safely Reclaiming Memory
- Approaches to memory reclamation
- Reference counting
- Tradeoffs
- Hazard pointers
- A hazard-pointer Treiber stack
- The hazard of Nightly
- Exercizing the hazard-pointer Treiber stack
- Epoch-based reclamation
- An epoch-based Treiber stack
- crossbeam_epoch::Atomic
- crossbeam_epoch::Guard::defer
- crossbeam_epoch::Local::pin
- Exercising the epoch-based Treiber stack
- Chapter 8: High-Level Parallelism - Threadpools, Parallel Iterators and Processes
- Thread pooling
- Slowloris - attacking thread-per-connection servers
- The server
- The client
- A thread-pooling server
- Looking into thread pool
- The Ethernet sniffer
- Iterators
- Smallcheck iteration
- rayon - parallel iterators
- Data parallelism and OS processes - evolving corewars players
- Corewars
- Feruscore - a Corewars evolver
- Representing the domain
- Exploring the source
- Instructions
- Individuals
- Mutation and reproduction
- Competition - calling out to pMARS
- Main
- Running feruscore
- Further reading.
- Chapter 9: FFI and Embedding - Combining Rust and Other Languages
- Embedding C into Rust - feruscore without processes
- The MARS C interface
- Creating C-structs from Rust
- Calling C functions
- Managing cross-language ownership
- Running the simulation
- Fuzzing the simulation
- The feruscore executable
- Embedding Lua into Rust
- Embedding Rust
- Into C
- The Rust side
- The C side
- Into Python
- Into Erlang/Elixir
- Chapter 10: Futurism - Near-Term Rust
- Near-term improvements
- SIMD
- Hex encoding
- Futures and async/await
- Specialization
- Interesting projects
- Fuzzing
- Seer, a symbolic execution engine for Rust
- The community
- Should I use unsafe?
- Other Books You May Enjoy
- Index.
- Notes:
- Includes bibliographical references.
- Description based on online resource; title from title page (Safari, viewed June 28, 2018).
- ISBN:
- 9781788478359
- 1788478355
- OCLC:
- 1042342284
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.