Reading 16: Mutual Exclusion
This reading brings together the ideas of concurrency and promises, in the context of an asynchronous abstract data type – an ADT with asynchronous operations that might run concurrently with each other, accessing the same shared (mutable) rep. We will see how this raises the risk of concurrency bugs, such as race conditions and deadlocks, which threaten the invariants and specifications that the ADT is striving to guarantee. By reasoning about interleaving of concurrent code, and taking advantage of mutual exclusion (periods when code is running by itself without interleaving), we can defend against those bugs. As a running example, let’s think about a library that allows users to borrow and return books. First, we’ll need some types to represent books and users: The operations have been omitted, because we won’t be calling any operations on users or books, just using them for their identity. Here is the library, and its two key operations checkout and checkin: This initial spec for c
Reading 16: Mutual Exclusion Reading 16: Mutual Exclusion Software in 6.102 Safe from bugs Easy to understand Ready for change Correct today and correct in the unknown future. Communicating clearly with future programmers, including future you. Designed to accommodate change without rewriting. Objectives This reading brings together the ideas of concurrency and promises, in the context of an asynchronous abstract data type – an ADT with asynchronous operations that might run concurrently with each other, accessing the same shared (mutable) rep. We will see how this raises the risk of concurren
Explore this link on the map →saved by
related reading
- Reading 15: Promisesweb.mit.edu
- Reading 23: Mutual Exclusionweb.mit.edu
- Reading 14: Concurrencyweb.mit.edu
- Problem Set 4: Memory Scrambleweb.mit.edu
- TypeScript Structured Concurrencythecandidstartup.org
- Let futures be futureswithout.boats
- What Async Promised and What it Delivered — Causalitycausality.blog
- LittleBookOfSemaphores.pdfgreenteapress.com
- Swift Concurrency Waits for No Onesaagarjha.com
- Futures and promises - Wikipediaen.wikipedia.org
- Microtasks and event looptr.javascript.info
- async/await on embedded Rust - Ferrous Systemsferrous-systems.com