On Thu, Oct 27, 2016 at 1:21 AM, Marko Rauhamaa <ma...@pacujo.net> wrote: > Analogous code in C or Java would not be guaranteed to finish if func1() > and func2() were in different execution contexts. In fact, it would be > almost guaranteed to hang. > > That is because the compiler can see that "active" cannot change within > T1.run() and would rewrite the code...
And since Python doesn't rewrite the code, you don't have a problem. Optimization has costs. ChrisA -- https://mail.python.org/mailman/listinfo/python-list