I may be wrong about this, but I don't think that Tk is "thread-safe".
| [reply] |
Usually, Tk is not thread safe. Which is why there is only one thread talking to Tk, and the other thread doing the work. The worker thread is not allowed to speak to Tk. Usually, the two threads communicate through a Thread::Queue.
| [reply] |
Calculate the bitmap using other tools then provide it all-at-once to the parent process to insert into the Tk-driven display. The updated bitmap should "just appear, all at once, poof." There's more than one way to do it.
| [reply] |
How sentient! Twenty years ago, I wrote a version of this program in C++ for 3.1. The executable failed to load in XP. The source was backed up on floppy (long since discarded). I do remember solving the analogous problem in an analogous way.
It recently occurred to me that modern hardware could probably compensate for the overhead of Tk and perl. I was right. My current version achieves slightly better performance than I remember from the ancient past.
| [reply] |