[Tutor] Re: Developing GUI-programs using IDLE

dman dsh8290@rit.edu
Sun, 21 Oct 2001 15:11:29 -0400


On Sun, Oct 21, 2001 at 02:03:47PM +0200, Gregor Lingl wrote:

| What a pity!
| Nevertheless, thanks to both of you.
| 
| I like to use it in interactive mode to show the working
| of Tkinter. It's quite nice to observe Tkinter-Objects react on
| single (e.g. config-) statements step by step, and it helps to learn
| Tkinter.
| 
| I wonder, if it would be possible to enhance IDLE (which (version 0.8)
| still seems to be in an unmature state) by some sort of multi-threading
| mechanism, so GUI-apps could run (and be killed) in a separate thread?

Not with threads.  Threads can't be killed externally, they can only
be stopped "nicely" internally.  The reason for that is the "other"
thread shares the same memory and resources, etc, with the rest of the
threads.  The kernel can't determine which resources to release, etc,
because it doesn't know what belongs to that thread and what belongs
to the other threads.  Some people contend that threads are bad hacks
and that light-weight processes and IPC should be used instead of
threads.  A separate process can be killed because it has its own set
of resources and the kernel can clean up after it when another process
sends it SIGKILL.

| Or is this impossible because of inherent limitations to Tkinter?

It is just much more complicated and no one has yet bothered to add
external process support to any of the existing IDEs.  Everyone has so
far found it much easier to just run the app separately.

HTH,
-D