[Python-Dev] PEP needed? Introducing Tcl objects

Guido van Rossum guido@python.org
Sat, 16 Feb 2002 11:28:01 -0500


> > > The Sleep() call is a perf problem.
> > 
> > It certainly is, but it is also necessary to have.
> 
> Why?  I suspect if you inverted the control behavior to run the
> Tcl event loop as it's designed and trigger signals with
> Tcl_AsyncMark, you would have no problem.  Alternatively, you
> could do Tcl_CreateEventSource, of if threading is really
> necessary, build Tcl with threads and use Tcl_ThreadQueueEvent.
> It has all the APIs to approach this from several different
> angles without have to toss a gratuitous Sleep in there that
> does nothing more than have people scratch their head and
> wonder why Tkinter appears so slow.

Jeff, I really hope you can help us with this.  I know it's a twisted
mess.  Years ago, I asked Ousterhout's help, but he was already too
busy to pay attention to a competing language designer. :-(

I hope that it's possible to do something better with Tcl/Tk 8.3 that
doesn't require the sleep and maintains the existing _tkinter API /
semantics.

> BTW, I know you were tying into Tk before Tk was properly
> thread-safe, but those issues have been addressed (although
> it is highly recommended to stick to using Tk in one thread
> as things like X aren't guaranteed to be thread-safe).

Are they solved in Tcl/Tk 8.3?  I'd be happy to require that version.
I'm not (yet) happy to require an alpha/beta of 9.0 or whatever the
Tcl community is now working at.

--Guido van Rossum (home page: http://www.python.org/~guido/)