A Failed Attempt: Just Using Loads/Stores

This lesson discusses how the use of loads and stores to implement locks, falls short.

We'll cover the following

To move beyond interrupt-based techniques, we will have to rely on CPU hardware and the instructions it provides us to build a proper lock. Let’s first try to build a simple lock by using a single flag variable. In this failed attempt, you’ll see some of the basic ideas needed to build a lock, and (hopefully) see why just using a single variable and accessing it via normal loads and stores is insufficient.

Get hands-on with 1200+ tech skills courses.