Implementing gevent locks
Previously we talked about gevent's hub and how greenlets switch in and out of it to implement IO. This time, let's talk about how we can use those same primitives, plus the properties that make greenlets greenlets, to implement locks. We'll start by walking through some basics about locks and move on to how locks are used in Python when working with threads. All of that will be background for finally covering how gevent implements greenlet-based locks.