
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 There are lots of ways this analogy could be extended with amusing consequences (just remembering back to when I used to regularly teach teenagers - they would have had a field day with it). :-) "It's like there's just one loo (but make sure you don't block)." (Sorry). :-P N. On 12/01/13 02:56, kirby urner wrote:
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-...
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQEcBAEBAgAGBQJQ8c3wAAoJEP0qBPaYQbb6un4H+wZWOCV+ILnqEK+X5abwMzZd R8g5CnRRo1I2nyUFi5WZN3IhlYa2BG3JJF50gzWvxvrVyMYUPDgbf6xxyN2f99UX NEnmpigW7SniWUpVfW6Ehr5PPdabT3piYVUpyygtr27ElN78l4zWMx6ojmmm8lLQ uo4lrimZAG0i843IqbbQ+n93qF+lRCEnN9e25yvwO/c8SiVi6kY2rLqxW/fds1YA M5W2fOAVdrwFsNAA/T7q/htFWaBmb+EY0t52WAmS49btcvEck4l8Gj3lY7brYoMv HrtnQ8iNyVDecRhqnC+XvzsSHcJ2/3754bgc/OS8Wc3kWVvkPjOQ5jnkFvGmNq4= =fiWY -----END PGP SIGNATURE-----