in reply to Tk + threads

This may not be helpful as my Tk experience is V. limited - but I would.
1. Have code to create TK objects
2. Create a Thread::Queue and a threads::shared variable to check if process is finished.
3. Create 'thread' passing in my Queue as param
4. Within thread, launch separate prog. Write prog's ouput to Queue. Set the threads::shared variable when complete.
5. In main body, loop and check for output on Queue with dequeue_nb. If I get some, write it to Tk objects. Check threads::shared variable to see if process is finished. When process is finished exit loop.
6. Join threads.

Replies are listed 'Best First'.
Re^2: Tk + threads
by knirirr (Scribe) on Jan 10, 2006 at 16:42 UTC

    Thanks for your suggestions. I've knocked up something along those lines, which works until the end of the script at which point I see a barrage of errors on STDOUT, e.g.

    Unbalanced string table refcount: (2) for "VERSION" during global dest +ruction. Scalars leaked: -3118

    Do you have any idea of what this might be?