http://www.perlmonks.org?node_id=11125704


in reply to Re^2: Tk with thread and stram data
in thread Tk with thread and stram data

Interesting posts in the thread that you referenced. I didn't have time to run any actual code, but it appears to me that in one post, Tk as running in one thread and a single worker in another thread. Communication between the two threads was via shared memory with a simple lock mechanism. "msg ready" only set by the worker thread and only cleared by the Tk thread. The worker wouldn't be able send another message until the Tk thread clears the shared memory semaphore "msg ready" flag.

I suspect that there is an answer where the Tk thread polls a shared memory structure every 100 ms or so and accepts work if there is any to be done. Tk cannot wait at an exchange indefinitely or the other GUI buttons will "hang".