Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 53c9283fc00bd7f62e7275d501e38bcf5d831c3e
Ticket: 577014ffffffffffffffffffffffffffffffffff
documentation; wait on thread exits
User & Date: vasiljevic on 2002-08-06 21:13:26
Changes

  1. icomment:
    Logged In: YES 
    user_id=95086
    
    1. Because Tcl API < 8.4 misses neccessary support calls.
    
    2. Documentation defines "thread::create" and thread::join"
    commands. It is not clear that these two are only for 8.4 
    core but this is corrected in the CVS.
    
    2.1 Thread may exit as and when it wishes. The thread::join 
    assures that the caller gets its return code (0-ok, 1-error)
    and that that caller knows exactly that the thread has exited.
    
    2.2 The exiting thread removes itself from the list. If it is 
    created as joinable, its status can be collected with the
    thread::join".
    
    3.1 Yes. The script halts until the thread does the 
    thread::unwind or the caller does the thread::release.  After 
    that, all commands *after* the thread.:wait will be executed
    and at the end of the script, the thread will exit. One can do 
    an thread::exit instead of thead::unwind. This causes the 
    thread to exit immediately. This is not advised, though (see 
    the docs about thread::exit and thread::unwind).
    
    3.2 The function which creates a thread and waits for its 
    exit is already in place. Just do a thread::create "..." where
    "..." is a Tcl script. Thread will be created, it will run the
    script and exit when done. This will trigger one thread only. 
    I'm planning to implement thread pools where one can 
    create several threads, not just one, and feed them with 
    work.
    
    4. thread::create creates a non-reserved thread. This is just 
    for backward compatiblity. I wanted to make and option for 
    thread::create where one can create and reserve the 
    thread in one atomic operation. This will be
    included in next release of the extension.
    
    5.1 All Tcl variables are bound to a thread. You can't share
    Tcl variables between threads. You can share their values
    by putting them in thread shared arrays. Only means of 
    exchanging data between threads is over script-passing or
    thread shared arrays.
    
    5.2. tsv::names is an empty list on thread start. All thread 
    shared variables are created by user action.
      
    
    
  2. login: "vasiljevic"
  3. mimetype: "text/plain"
  4. username: "vasiljevic"