Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0006c77edc443c248f226056a86f309640101189de5a5650a67fbfaef1922c7c
Ticket: e8efa378a96bca5e69e00e5feff1315c932ed47b
Duplicate std* channels in different Threads
User & Date: serhiy.storchaka on 2026-10-14 18:14:04
Changes

  1. icomment:
    The first part is the documented behavior. In wish on Windows a new thread has no standard channels, and as described in Tcl_StandardChannels(3), "the first three Tcl channels then opened by the application are designated as the Tcl standard channels"; a standard channel cannot be transferred. On Linux, and in tclsh on Windows (as you wrote), the new thread gets its own stdin, stdout and stderr.
    
    The second part is expected too: the standard channels of all threads refer to the same standard handles of the process, so closing stdout in one thread closes the process's standard output, just as closing stdout does in a single-threaded program.
    
  2. login: "serhiy.storchaka"
  3. mimetype: "text/x-fossil-wiki"
  4. resolution changed to: "Invalid"
  5. status changed to: "Closed"