An introduction to asynchronous Python
An introduction to asynchronous Python
Posted Jun 30, 2017 12:43 UTC (Fri) by excors (subscriber, #95769)Parent article: An introduction to asynchronous Python
I think the main advantage of the async model over threading may be that you don't have to understand synchronisation - it avoids all those mutexes, semaphores, events, conditions, atomics, implicitly atomic operations in a particular interpreter implementation, GIL, ... Instead, all your code is guaranteed to run atomically except where there's a clearly-visible "await". Given that essentially no human beings are capable of understanding synchronisation perfectly in any non-trivial cases, that's a substantial benefit.
Posted Jul 1, 2017 0:25 UTC (Sat)
by neilbrown (subscriber, #359)
[Link] (1 responses)
That's a bold claim!
You point still stands, though, that it may be easier to train people in asynchrony than in synchrony.
Posted Jul 7, 2017 17:16 UTC (Fri)
by HelloWorld (guest, #56129)
[Link]
An introduction to asynchronous Python
I think it much more likely that we don't have, or are not using, suitable semantic tools to enable us to think about synchronization in a reliable way.
By "semantic tools" I mean things like "loop invariants", which I personally find make it much easier to think accurately about loops.
I think a lot of synchronization errors come about because people are either not informed about the locking requirements, or think they can take a short cut without justifying it. This suggests that it isn't a lack of capability, but a lack of tools and training.
An introduction to asynchronous Python