Skip to content
Tcl Source Code History Of Ticket 3584573
Login

History Of Ticket 3584573

Artifacts Associated With Ticket 3584573

  1. Ticket change [1433b5c35e] (rid 124347) by dvrsn on 2012-11-06 00:50:29:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      recent versions of Linux support pthread_attr_setstacksize, but HAVE_PTHREAD_ATTR_SETSTACKSIZE is not defined for linux.  As a result, no stack size requests are handed in Tcl_CreateThread, meaning the default is always used.  On linux the default stack size is the maximum possible stack size (i.e., the RLIMIT_STACK soft limit at program start time), which is typically 8Mb.
      
      Even if stack size setting was enabled for linux, the notifier thread is created with the default size, and this is not changeable, meaning every threaded tclsh has minimum 8Mb overhead, even if no application threads are used.
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "dvrsn"
    10. subsystem initialized to: "49. Threading"
    11. title initialized to: "cannot set thread stack size on linux"
    12. type initialized to: "Bug"
  2. Ticket change [8b7f47612e] (rid 127576) by ferrieux on 2012-11-06 23:01:46:

    1. icomment:
      While the suggestion to allow this setting is obviously valid, please notice that on Linux systems this "8Mb overhead" only costs in virtual address space, not real RAM, thanks to overcommit. To verify this, let's look at a 8.6HEAD threaded build on Linux 32b:
      
      Notifier thread stack segment as seen in pmap: 10MB
      
         b6e93000  10248K rw---    [ anon ]
      
      Real usage as seen in /proc/PID/smaps: only 16kB
      
      b6e93000-b7895000 rw-p 00000000 00:00 0 
      Size:              10248 kB
      Rss:                  16 kB
      Pss:                  16 kB
      Shared_Clean:          0 kB
      Shared_Dirty:          0 kB
      Private_Clean:         0 kB
      Private_Dirty:        16 kB
      Referenced:           16 kB
      Swap:                  0 kB
      KernelPageSize:        4 kB
      MMUPageSize:           4 kB
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  3. Ticket change [dad0175e59] (rid 107856) by dvrsn on 2012-11-07 07:54:19:

    1. icomment:
      This does limit the number of threads that can be created on a 32-bit system to a much smaller number (around 365 on my machine) than would otherwise be the case.
      
      It's possible to adjust the overcommit behavior, although I doubt doing so is very common.
      
      It also may be the case (I wasn't able to find a definitive answer one way or the other) that in some virtualized environments (e.g., OpenVZ) the OOM killer looks at allocated rather than used pages.  This could lead to threaded apps being unfairly targeted.
      
      
    2. login: "dvrsn"
    3. mimetype: "text/plain"
    4. username: "dvrsn"