Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 755168baf28b70cdd98b91e81852f5544867476c
Ticket: 3056775fffffffffffffffffffffffffffffffff
Socket -server stops accepting connections under load
User & Date: andreas_kupries on 2010-09-23 04:23:55
Changes

  1. assignee changed to: "hobbs"
  2. icomment:
    Hi Twylite. Having started to look into this a few questions ...
    
    Can you provide us with a unified diff for the patch ? Or context diff. Anything which tells me not just the line numbers, but also shows the relevant code and things around it. Using the line number with Tcl Head it seems that you are putting the locks around the statement
    
        "infoPtr->acceptEventCount--;"
    
    however I am not sure. With the plain patch I am left guessing. even if my guess seems sensible.
    Except that there are other statements also modifying/querying acceptEventCount and possinbly should be locked as well.
    
    Another issue I have is that it is extremely unclear how this structure is modified by multiple threads. This may be my own non-knowledge of the (windows) notifier, so I hope you can enlighten me.
    
    First, the socket should be owned by a single thread and no other should access it.
    
    Second,  when I traced the call-sequence a bit I saw that TcpAccept is called by SocketEventProc, which is the action function for an Event. Events are in queues, one queue per thread, so when a socket is ready the newly minted event is put into a single queue, of the current thread.
    
    So, if multiple threads truly access the structure, then that may be the bug, making the locks you set a band-aid hiding the actual problem. I hope you understand now why I wish to know more.
    
    I am now temporarily re-assigning this bug to Jeff to get his input on this well.
    
    
  3. login: "andreas_kupries"
  4. mimetype: "text/plain"
  5. priority changed to: "9 Immediate"
  6. username: "andreas_kupries"