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

not execute thread with button you can also remove button of my example inspire me this post https://www.perlmonks.org/?replies=1;displaytype=print;node_id=732294 but i dont know why for me , reply only one time in tk

Replies are listed 'Best First'.
Re^3: Tk with thread and stram data
by Marshall (Canon) on Dec 24, 2020 at 01:10 UTC
    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".