On Tue, Mar 11, 2014 at 5:38 PM, Chris Angelico <ros...@gmail.com> wrote: > On Wed, Mar 12, 2014 at 10:18 AM, Marko Rauhamaa <ma...@pacujo.net> wrote: >> Chris Angelico <ros...@gmail.com>: >> >>> What corner cases are there with threads that you don't have with >>> anything else? >> >> There are numerous. Here's one example: deadlocks due to two threads >> taking locks in a different order. The problem crops up naturally with >> two intercommunicating classes. It can sometimes be very difficult to >> spot or avoid. > > Yep. Now how is that not a problem when you use some other model, like > an event loop? The standard methods of avoiding deadlocks (like > acquiring locks in strict order) work exactly the same for all models, > and are just as necessary.
If you don't have threads then the only locks you need to acquire are for external resources. You might still deadlock, but at least your process won't be deadlocking with itself. -- https://mail.python.org/mailman/listinfo/python-list