Asynchronous programming

Paul Rubin no.email at nospam.invalid
Thu Aug 11 03:01:06 EDT 2016


Christian Gollwitzer <auriocus at gmx.de> writes:
> I'm convinced that it is possible to integrate Tcl's event loop with
> asyncio's loop without regular update polling. This might require a
> patch to Tkinter at the C level. For example, an easy way is to put
> Tcl/Tk in it's own thread. ...

I did something like that a while back, putting tkinter in its own
thread but also using its .after() method to wake up the tkinter loop
every 50 msec or something like that.  I didn't notice any significant
cpu load or UI lag from that, and it was on a fairly slow machine (300
mhz ARM, I think).  The tkinter thread received callbacks from tkinter
and passed them on to the application's main dispatch loop through a
normal Python queue.  So there was no need to patch the tkinter C code.



More information about the Python-list mailing list