You are given a simple multi-threaded component that protects all shared state with a single mutual-exclusion lock (mutex).
A service has many worker threads calling get(key) and put(key, value) on a shared in-memory key–value store (e.g., a hash map). The current implementation uses one global mutex around the entire get/put logic to ensure correctness.
Login required