[pypy-issue] [issue1597] Tkinter needs a threaded tcl

Amaury Forgeot d'Arc tracker at bugs.pypy.org
Sun Sep 8 20:24:24 CEST 2013

Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

It's not difficult to do, but tedious.
When tcl is not threaded, a lock needs to be acquired/released for all tcl operations. See all the 
"ENTER_TCL" macros in _tkinter.c.
In our implementation, this could be replaced by a "with self._lock_tcl():" block, which would be 
a no-op when tcl is threaded.
At least with cffi we don't have to bother about the GIL (and Py_BEGIN_ALLOW_THREADS and the 
tcl_tstate variable)

nosy: +amaury

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list