• Re: thread::release from worker thread

    From Harald Oehlmann@21:1/5 to All on Mon Dec 18 17:33:54 2023
    Am 18.12.2023 um 15:43 schrieb Oleg Nemanov:
    Hi, all.

    I have tcl app, that has 1 main thread and some worker threads. And sometimes (about 1 time of 10) tcl crash on exit with the next error:

    target thread died
    while executing
    "thread::send [dict get $v worker_tid] deinit"
    (procedure "devs_deinit" line 6)
    invoked from within
    "devs_deinit"
    (procedure "conn_read" line 17)
    invoked from within
    "conn_read ::req-sock5560df97d0"

    The exit procedure is the next:
    - main thread get "quit" command from tcp management socket
    - main thread do "thread::send WORKER_ID deinit" for each worker
    - worker thread has "thread::release [thread::id]" as last action in deinit proc

    When i move thread::release from worker thread deinit proc into main thread, then i got no errors. Is it wrong to call thread::release from worker thread like i did?

    Oleg,
    I suppose, you are facing a bug in Thread 1.6.6 ?
    What is your Thread package, TCL, Platform ?

    Take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Mon Dec 18 18:10:38 2023
    Am 18.12.2023 um 17:51 schrieb Oleg Nemanov:
    понедельник, 18 декабря 2023 г. в 19:33:59 UTC+3, Harald Oehlmann:
    Oleg,
    I suppose, you are facing a bug in Thread 1.6.6 ?

    Hm. My Thread package version is 2.8.7.

    What is your Thread package, TCL, Platform ?

    % puts $tcl_version
    8.6
    % puts [array get tcl_platform ]
    osVersion 4.19.85-v8+ pointerSize 8 byteOrder littleEndian threaded 1 machine aarch64 platform unix pathSeparator : os Linux engine Tcl user USER wordSize 8
    % package require Thread
    2.8.7


    Reading again your message: I suppose, you may not do a "thread release"
    in that thread. Or, at least, the result "thread died" is correct, it died.

    Wizards will hopefully answer. I reacted to quick.

    Sorry,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)