Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c65c24cddcde22431d1b97acfb0bb30e2bece072ca8a1b9a469432869f853a18
Ticket: e8efa378a96bca5e69e00e5feff1315c932ed47b
Duplicate std* channels in different Threads
User & Date: JKU on 2026-10-14 20:05:01
Changes

  1. icomment:
    And that is my problem here:
    
    * New channels in other threads may get std* names.
    * Those channels can not be transferred to other threads.
    * Related, but maybe a different bug: closing std* channels closes the underlying fd/handle, but leaves the channel hanging.
    
    This results in:
    
    * Extra code may be needed to "occupy" the channel names if a channel should be created with the intention to transfer it later.
    * Complicated mental model around standard channels.
    
    I did hope that there would be a discussion about this, with may result in (your pick):
    
    * All std* refer to the same underlying fd/handle, regardless if executed on wish/tclsh.
    * Closing std* channels makes them disappear in all threads.
    * Creating new channels does not name them std* if an other thread already has a channel with that name.
    
    or
    
    * Channels created with a name like std* are shared across all threads.
    
    I think that there might be some improvement in the way Tcl handles replacing std* channels and threads.
    
    The current behavior is documented, but... I am not really happy with it as it stands.
    
  2. login: "JKU"
  3. mimetype: "text/x-markdown"