Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4a732ea7ab9a04d01eab36724ff60f45d8a26726
Ticket: 8bd13f07bde6fb0631f27927e36461fdefe8ca95
Closing tcl pipes prevents windows threads from starting up
User & Date: sebres on 2017-04-05 19:38:25
Changes

  1. icomment:
    Unfortunately neither the original proposed patch nor my rewritten branch do not completely solve the issue (despite it is indeed better with both fixes);
    I could reproduce again a suspend state of [9d75181] with original path and 
    a dead-lock inside kernel with my branch (I've a newer version in-between without suspend/resume using SignalObjectAndWait instead, that is still more better but nevertheless error-prone).
    
    I suspect this going to the undefined behavior resp. rather unexpected here, because under windows a thread waiting on a synchronization object can be momentarily removed from the wait state by a kernel-mode APC, and then returned to the wait state after the APC is complete (per design).
    
    I think the only way would be to rewrite current handling completely using either async-IO (overlapped ReadFileEx/WriteFileEx) or using simple thread pool for the pending reader/writer, that firstly will become reusable functionality (like get pending or create), secondly can be sane removed after reach of some timeout resp. by system shutdown (e. g. within handler created with Tcl_CreateExitHandler).
    
    I have experience with windows async-IO (and iocp), so can rewrite it with it.
    I will take a look on winPipe, etc. and think about a little bit...
    
  2. login: "sebres"
  3. mimetype: "text/plain"