Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

_tkinter.c, threads and C-modules



Python python RSS feed   Index | Next | Previous | View Threaded

herzog at online

Apr 9, 1999, 12:04 PM

Post #1 of 1 (478 views)
_tkinter.c, threads and C-modules

A few weeks ago, there was a bug report on c.l.py regarding an
incompatibility between Sketch and Python 1.5.2b2. It seems to me that
the cause for the problems is the new Tcl-lock in 1.5.2.

The tcl-lock was introduced for better thread support in Tkinter.
Whenever _tkinter calls the tcl interpreter, it releases the python-lock
and acquires the tcl-lock. Sketch defines some tcl-callbacks in C, which
in turn may call the python interpreter, but without releasing the
tcl.lock and acquiring the python-lock. I think that this is the cause,
because compiling just the _tkinter module without thread support cures
the problem.

The question now is, how do I make Sketch work correctly with a
threadable _tkinter? AFAICT, Sketch would have to have access to some
static variables in _tkinter.c.

The best solution IMO would be to give third-party C-modules access to
the functionality of the macros ENTER_TCL, LEAVE_TCL, etc, via some
C-functions to access those variables and a _tkinter headerfile
installed with the other Python headerfiles.

Any chance to get something like this into Python 1.5.2 final?


Bernhard Herzog | Sketch, a python based drawing program
herzog [at] online | http://www.online.de/home/sketch/

Python python RSS feed   Index | Next | Previous | View Threaded

Interested in having your list archived? Contact Gossamer Threads
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.