[openstack-dev] [oslo] Add a new aiogreen executor for Oslo Messaging

Donald Stufft donald at stufft.io
Mon Nov 24 02:24:47 UTC 2014

> On Nov 23, 2014, at 9:09 PM, Mike Bayer <mbayer at redhat.com> wrote:
>> On Nov 23, 2014, at 8:23 PM, Donald Stufft <donald at stufft.io> wrote:
>> I don’t really take performance issues that seriously for CPython. If you care about performance you should be using PyPy. I like that argument though because the same argument is used against the GCs which you like to use as an example too.
>> The verbosity isn’t really pointless, you have to be verbose in either situation, either explicit locks or explicit context switches. If you don’t have explicit locks you just have buggy software instead.
> Funny thing is that relational databases will lock on things whether or not the calling code is using an async system.  Locks are a necessary thing in many cases.  That lock-based concurrency code can’t be mathematically proven bug free doesn’t detract from its vast usefulness in situations that are not aeronautics or medical devices.

Sure, databases will do it regardless so they aren’t a very useful topic of discussion here since their operation is external to the system being developed and they will operate the same regardless.

There’s a long history of implicit context switches causing buggy software that breaks. As far as I can tell the only downsides to explicit context switches that don’t stem from an inferior interpreter seem to be “some particular API in my head isn’t as easy with it” and “I have to type more letters”. The first one I’d just say that constraints make the system and that there are lots of APIs which aren’t really possible or easy in Python because of one design decision or another. For the second one I’d say that Python isn’t a language which attempts to make code shorter, just easier to understand what is going to happen when.

Throwing out hyperboles like “mathematically proven” isn’t a particular valuable statement. It is *easier* to reason about what’s going to happen with explicit context switches. Maybe you’re a better programmer than I am and you’re able to keep in your head every place that might do an implicit context switch in an implicit setup and you can look at a function and go “ah yup, things are going to switch here and here”. I certainly can’t. I like my software to maximize the ability to locally reason about a particular chunk of code.

Donald Stufft
PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

More information about the OpenStack-dev mailing list