
Jan. 12, 2013
2:56 a.m.
I think an obvious way to describe the use of locks when multi-threading is to use the coffee shop model (same as airplane model), where there's only one bathroom / toilet. Or maybe there are two but each takes its own key. Or mulitple unisex (still for one passenger only) like portable ones at the fair. boyz = threading.Lock() girlz = threading.Lock() Only one customer per bathroom at any one time, so there's a queue for the keys (we call them locks but they're like keys that unlock your access to the facilities, then you release it back at the counter so another customer might go). Kirby Speaking of airplanes.... Snakes on a plane: http://gawker.com/5974780/snake-on-a-plane-qantas-passenger-spots-python-on-... http://xkcd.com/107/