I suspect that the difference is that your tclkit is functionally a "wish", whereas I'm running in "tclsh" and doing "package require Tk".

As for using Tk in multiple threads--all of the documentation I've seen on the Threads package that mentions Tk (as, for example, _Practical Programming in Tcl and Tk_) says not to do it.  It's not that it will fail immediately, but that it (under circumstances usually difficult to reproduce or debug) it will fail mysteriously.

Will

--
Will Duquette -- William.H.Duquette@jpl.nasa.gov
Athena Development Lead -- Jet Propulsion Laboratory
"It's amazing what you can do with the right tools."


On 11/1/11 6:43 PM, "Rusty Brooks" <me@rustybrooks.com> wrote:

I just tried and it works perfectly fine btw.  Also, I didn't have to do any kind of thread::wait or anything like that, seems to work OK as is with the setup I have (which is using a tclkit with the thread libraries built in)

See attached script

On 11/1/2011 4:36 PM, Duquette, William H (318K) wrote:
Howdy!

Two questions:

1. I know that I can only use Tk in a single thread of a multi-threaded app.  Does it matter which thread it is, i.e., if Tk is NOT running in the main thread is it OK to invoke it in a thread created using thread::create?

(I've tried it; it appears to work; I just need to know whether it will cause me problems in the long run.)

2.  When I invoke Tk using [package require Tk] in a thread created using thread::create, it appears that I have to call [vwait] or [thread::wait] explicitly at the end of the thread startup script, or I don't enter the event loop.  Is this expected behavior?

Thanks very much!

Will
--
Athena Development Lead -- Jet Propulsion Laboratory
"It's amazing what you can do with the right tools."



------------------------------------------------------------------------------
RSA&#174; Conference 2012
Save $700 by Nov 18
Register now&#33;
http://p.sf.net/sfu/rsa-sfdev2dev1


_______________________________________________
Tcl-Threads mailing list
Tcl-Threads@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/tcl-threads