this room is occupied (multi-threading metaphor)

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/

-----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-----

On Sat, Jan 12, 2013 at 12:56 PM, Nicholas H.Tollervey <ntoll@ntoll.org> wrote:
-----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.
Funny you should mention as I'm just reviewing an old presentation where I get into the scatological / demented humor layer endemic at various levels, starting in fairly early childhood. Why not tap into that? "Mad libs" were my point-in-common, i.e. wacky stories with missing user-supplied elements, a way to get into the whole topic of string substitution, important to STEM even if current math standards don't see where it goes. Excepts from the slide show mentioned below: http://www.flickr.com/photos/kirbyurner/8373804657/in/photostream/lightbox/ http://www.flickr.com/photos/kirbyurner/8373804285/in/photostream/lightbox/ What I do in some courses is show how a Python class itself looks like a many-ribbed snake: class Python: def __rib__(self): pass def __rib__(self): pass def __rib__(self): pass def __rib__(self): pass def __rib__(self): pass def __rib__(self): pass (legal but useless except for diagramming purposes i.e. shows the "rib cage"). This begets the view of classes as organisms (perhaps genetically modified) with bowel functions, a metabolism. Hence the need for a self.stomach and snake.eat( ) and snake.poop() methods -- self.stomach a FIFO column. Kirby ---------- Forwarded message ---------- From: kirby urner <kirby.urner@gmail.com> Date: Sat, Jan 12, 2013 at 12:59 PM Subject: Re: thoughts about your paper To: David B Koski Yeah, I replied. I've done lots of conferences. Sometimes I just have to prepare slides and talk, other times a paper too. For EuroPython (Vilnius, Lithuania) I was asked to do a paper. It was not at all just a script for the slides. Paper: http://4dsolutions.net/presentations/urner_europython_2007.pdf Slides: http://4dsolutions.net/presentations/connectingthedots.pdf Kirby
participants (2)
-
kirby urner
-
Nicholas H.Tollervey