From meshparts@alexandru.dadalau@meshparts.de to comp.lang.tcl on Mon Jan 19 19:17:49 2026
From Newsgroup: comp.lang.tcl
Hi there,
What could cause this random error that I get in my Tcl/Tk app?
error writting "stdout": broken pipe while executing "puts $args"
Some background:
In the main app I create multiple threads.
I send to the different threads bysically the same command e.g.
"batchcmd" with different parameters to be processed in parallel.
The "batchcmd" command looks something like below.
The "cmdline" variable is the call to the same app executable as the
main app. So basically, the main app starts itself in different processes.
Many thanks
Alex
proc batchcmd {args} {
# Open different channels for read and write
lassign [chan pipe] processStdin writeChanId
lassign [chan pipe] readChanId processStdoutErr
# React when the read channel becomes readable (meaning, a new line
was written to the channel)
chan event $readChanId readable "::meshparts::GeneratePartBatchRead $readChanId $processStdoutErr"
# Start the part generation process
set res [::twapi::create_process "" -cmdline $cmdline -returnhandles
1 -inherithandles 1 -stdchannels [list $processStdin $processStdoutErr $processStdoutErr]]
# Store the process handles
lassign $res pid tid hproc hthread
# Wait for the process to end
set ::meshparts::twapi_pid($pid) ""
::twapi::wait_on_handle $hproc -executeonce 1 -async [list ::meshparts::GlobalVarSetFromTwapiCallback ::meshparts::twapi_pid($pid) ""]
vwait ::meshparts::twapi_pid($pid)
::twapi::close_handle $hproc
}
--- Synchronet 3.21b-Linux NewsLink 1.2
Who's Online
Recent Visitors
Microbot
Mon Feb 2 10:07:38 2026
from
Moore, Ok
via
Telnet
Noozle
Mon Feb 2 08:57:17 2026
from
Noozle City
via
Telnet
Microbot
Sun Feb 1 11:28:59 2026
from
Moore, Ok
via
Telnet
Noozle
Sun Feb 1 07:56:06 2026
from
Noozle City
via
Telnet