Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 48ef9deae82552c4bbadce388a69dd6ef3942a72
Ticket: 2005794fffffffffffffffffffffffffffffffff
tpool::create freezes when using minworkers
User & Date: rudenstam on 2008-06-29 10:42:07
Changes

  1. assignee changed to: "vasiljevic"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    When trying to use -minworkers when creating a threadpool, the tcl script just freezes up when the pool is to be created. This behaviour is irregular and the following code has been tested working on several platforms. On my previous linux installation, it worked 6/10 times, either it froze where indicated now, or it created the pool without trouble. That installation was a debian etch running tcl 8.4.
    
    The one I have this problem 10/10 times now, is a debian lenny. I got both tcl8.4.19 and tcl8.5.2 installed on it, and I get the exact same behaviour with both tcl versions. Thread was built from CVS to include the recent fix that closed bug 1965721.
    
    I'd be happy add any other information you might need and to try out any potential fix, as this probably will work on your end.
    
    Cheers
    rudenstam
    
    -----------------------------------------
     Code used to test this
    -----------------------------------------
    puts "Using tcl version: [info patchlevel]"
    puts "Loading threads version: [package require Thread]"
    
    set min 5
    puts "Creating the threadpool with: set pool \[tpool::create -minworkers $min\]"
    
    set pool [tpool::create -minworkers $min]
    
    puts "pool $pool created"
    
    -----------------------------------------
     Output of tclsh thread.tcl
    -----------------------------------------
    Using tcl version: 8.4.19
    Loading threads version: 2.6.5
    Creating the threadpool with: set pool [tpool::create -minworkers 5]
    
    -----------------------------------------
     Output of strace tclsh thread.tcl
    -----------------------------------------
    write(1, "Creating the threadpool with: se"..., 70Creating the threadpool with: set pool [tpool::create -minworkers 5]
    ) = 70
    mmap2(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6b22000
    mprotect(0xb6b22000, 4096, PROT_NONE)   = 0
    clone(child_stack=0xb73224c4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb7322bd8, {entry_number:6, base_addr:0xb7322b90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb7322bd8) = 14613
    futex(0x804c4c0, 0x81 /* FUTEX_??? */, 1) = 1
    futex(0x809a118, 0x81 /* FUTEX_??? */, 1) = 1
    futex(0x809a11c, 0x80 /* FUTEX_??? */, 1) = -1 EAGAIN (Resource temporarily unavailable)
    futex(0x804c4c0, 0x81 /* FUTEX_??? */, 1) = 0
    mmap2(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6321000
    mprotect(0xb6321000, 4096, PROT_NONE)   = 0
    clone(child_stack=0xb6b214c4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb6b21bd8, {entry_number:6, base_addr:0xb6b21b90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb6b21bd8) = 14614
    futex(0x804c4c0, 0x81 /* FUTEX_??? */, 1) = 1
    futex(0x809a118, 0x81 /* FUTEX_??? */, 1) = 1
    futex(0x809a11c, 0x80 /* FUTEX_??? */, 4) = -1 EAGAIN (Resource temporarily unavailable)
    futex(0x804c4c0, 0x81 /* FUTEX_??? */, 1) = 0
    mmap2(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb5b20000
    mprotect(0xb5b20000, 4096, PROT_NONE)   = 0
    clone(child_stack=0xb63204c4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb6320bd8, {entry_number:6, base_addr:0xb6320b90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb6320bd8) = 14615
    futex(0x804c4c0, 0x81 /* FUTEX_??? */, 1) = 1
    futex(0x809a118, 0x81 /* FUTEX_??? */, 1) = 1
    futex(0x809a11c, 0x80 /* FUTEX_??? */, 9) = -1 EAGAIN (Resource temporarily unavailable)
    futex(0x804c4c0, 0x81 /* FUTEX_??? */, 1) = 0
    mmap2(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb531f000
    mprotect(0xb531f000, 4096, PROT_NONE)   = 0
    clone(child_stack=0xb5b1f4c4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb5b1fbd8, {entry_number:6, base_addr:0xb5b1fb90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb5b1fbd8) = 14616
    futex(0x804c4c0, 0x81 /* FUTEX_??? */, 1) = 1
    futex(0x809a118, 0x81 /* FUTEX_??? */, 1) = 1
    futex(0x809a11c, 0x80 /* FUTEX_??? */, 16) = -1 EAGAIN (Resource temporarily unavailable)
    futex(0x804c4c0, 0x81 /* FUTEX_??? */, 1) = 1
    mmap2(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb4b1e000
    mprotect(0xb4b1e000, 4096, PROT_NONE)   = 0
    clone(child_stack=0xb531e4c4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb531ebd8, {entry_number:6, base_addr:0xb531eb90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb531ebd8) = 14617
    futex(0x804c4c0, 0x81 /* FUTEX_??? */, 1) = 1
    futex(0x809a118, 0x81 /* FUTEX_??? */, 1) = 1
    futex(0x809a11c, 0x80 /* FUTEX_??? */, 25) = -1 EAGAIN (Resource temporarily unavailable)
    futex(0x804c4c0, 0x81 /* FUTEX_??? */, 1) = 1
    write(1, "pool tpool0x8063ed0 created\r\n", 29pool tpool0x8063ed0 created
    ) = 29
    futex(0x809a11c, 0x84 /* FUTEX_??? */, 1) = 4
    futex(0x809b598, 0x81 /* FUTEX_??? */, 1) = 1
    futex(0x8088e64, 0x80 /* FUTEX_??? */, 1
    
    
    
  4. foundin changed to: "obsolete: 8.4.19"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "rudenstam"
  10. subsystem changed to: "80. Thread Package"
  11. title changed to: "tpool::create freezes when using minworkers"
  12. type changed to: "Bug"