in reply to [solved] Long-running DB query makes Tk application unresponsive
Just brainstorming..... but you should be able to work out a way of getting the data back from the thread, without it totally finishing. Maybe the way the SQL works, it has to be that way, but the thread could set a shared flag when it knows one portion of the data is retreived, and you could setup a timer in the main Tk thread to repeatedly check the flag, and do what is neccesary to read the completed section. Maybe if you thought about it, you could figure out a method for the thread to detect when a column is ready to be populated, then have it set the shared flag, and put the column number( or whatever) in another shared variable. Then as the Tk loop goes through it's wait-timer, it will process that column as it detects it is ready. That way, you will see the columns fill as they are individually finished. Just setup a shared array @columns_finished. Have the thread push finished columns into @columns_finished, and have a Tk timer, watch for and shift off of @columns_finished and send it to the Columns widget.
P.S. If this script is more than a "1-shot deal", you should make your thread reusable, instead of launching multiple async threads.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Long-running DB query makes Tk application unresponsive
by radiantmatrix (Parson) on Oct 14, 2005 at 17:43 UTC | |
by zentara (Cardinal) on Oct 14, 2005 at 18:47 UTC |