Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6b26031e1b8dca7b576f888f336730f73f105daf
Ticket: 1437595fffffffffffffffffffffffffffffffff
WinSock cores/hangs on thread or app exit
User & Date: vasiljevic on 2006-03-19 00:40:31
Changes

  1. icomment:
    Logged In: YES 
    user_id=95086
    
    Damn. 
    
    The more I dig into that, the more dirt comes out...
    
    My humble conclusion is that the entire init/teardown of 
    Tcl is a patchwork. It is not possible to change an A without
    getting the Z affected :-(
    
    As I see, the socket subsystem is defined to be loaded lazy.
    Means, first thing that pulls any socket-related functionality
    being it [socket] command or any exported C-API call will
    eventually load and initialize the entire subsystem.
    Per-se this is not a bad idea as it conserves resources.
    But it creates problems if you need to have a call like TclpHasSockets.
    
    This one is one of the callers of InitSockets() so if InitSockets() block
    the caller will block as well. If you divorce those two, then you need to
    explicitly load the socket subsystem, which is what I wanted to do.
    But then, you end up in a situation that you need to do this before
    doing *anything* else with C- or Tcl-API. Unfortunately there is no
    such hook in the API. 
    
    So I will have to think little bit more. 
    
    Current situation is: TclpHasSockets() will block until InitSockets() has
    created the complete environment *including* the helper socket thread
    and the associated window. I personally do not see any problem in
    such behaviour.  Yet, I will try another attempt, but the future does not
    look bright... unless we re-write the entire per-thread initialization
    stuff which I would not like to do at this time.
    
    
    
    
  2. login: "vasiljevic"
  3. mimetype: "text/plain"
  4. username: "vasiljevic"