in reply to Re: Tk and Threads (again)
in thread Tk and Threads (again)

Is this for having a second MainLoop? (another seperate Tk thingy) If so, nice! Since the only thing they share is the one scalar from $thread_queue (which is just the path to where the file is). Rest is created in the thread and shown. No need to return anything if the thread can do it all!

Replies are listed 'Best First'.
Re^3: Tk and Threads (again)
by renodino (Curate) on Jan 22, 2006 at 22:54 UTC
    Is this for having a second MainLoop?

    No, its just a means to simplify the interaction between threads; you shouldn't need a 2nd MainLoop, just a $mw->repeat() call within the Tk thread that goes off to test the Thread::Queue every 100 msecs or so. The rest of the threads use the client proxy as a surrogate for making calls directly on $mw. (Of course, there's the little matter of marshalling params to the Tk thread, and getting results back...again, see Thread::Apartment for its marshal/unmarshal methods.)

    Hopefully, I'll find time in the next couple of months to finalize Thread::Apartment support for closures, plus a few other things, and then implement a Tk::Threaded that will make all of this much simpler.

      Now, that would be lovely to implement for you all actually! :)