in reply to How to run multiple server processes under Tk?
So you will not be able to "launch a new thread with a button click", however, you can signal an existing thread to do something. Create 2 sleeping threads first, then start a Tk front-end to control them. Check out Tk-with-worker-threads for an example of how it can be done.
The shared hashes and sleeping thread setup is the basic model I use with Tk, and works fine on linux and windows( earlier version of Windows like 95, 98, Me; don't handle big shared hashes very well. But this example works.)
The thing to remember with Tk and shared variables in threads, is that Tk will not "know" what the shared data is, until it actively tries to read it. So you can't use a shared variable as a reference, and expect it to update automatically....you need a timer to repeatedly check it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to run multiple server processes under Tk?
by noslenj123 (Scribe) on Sep 20, 2005 at 17:22 UTC | |
by zentara (Cardinal) on Sep 20, 2005 at 17:55 UTC |