[Python-Dev] Pythonic concurrency

Barry Warsaw barry at python.org
Fri Oct 7 20:58:25 CEST 2005


On Fri, 2005-10-07 at 14:42, Shane Hathaway wrote:

> What's insanely difficult is really locking, and locking is driven by 
> concurrency in general, not just threads.  It's hard to reason about 
> locks.  

I think that's a very interesting observation!  I have not built a
tremendous number of concurrent apps, but even the dumb locking that
Mailman does (which is not a great model of granularity ;) has burned
many bch's (brain cell hours) to get right.

Where I have used more concurrency, I generally try to structure my apps
into the one-producer-many-independent-consumers architecture that was
outlined in a previous message.  In that case, if you can narrow your
touch points to the Queue module for example, then yeah, threading is
easy.  A gaggle of independent workers isn't that hard to get right in
Python.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20051007/09266eeb/attachment.pgp


More information about the Python-Dev mailing list