How to use two threads (GUI and backend)

Chris Angelico rosuav at gmail.com
Wed Oct 26 10:33:34 EDT 2016


On Thu, Oct 27, 2016 at 1:21 AM, Marko Rauhamaa <marko at 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



More information about the Python-list mailing list