Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 73f31cf2783258e85e3295382264beab79489524
Ticket: 659131ffffffffffffffffffffffffffffffffff
development targets: Complete pthreads?
User & Date: vasiljevic on 2002-12-28 21:06:47
Changes

  1. icomment:
    Logged In: YES 
    user_id=95086
    
    1.  
    Semaphores are ok. So are critical sections and recursive 
    locks. But, what I want to achieve is *simplicity*. Thread 
    programming has become pretty simple thanks to the Tcl 
    compartment thread model. If you look at the tpool.tcl source 
    you won't find a single condition variable or a mutex. Yet, 
    relatively complex implementation of threadpool is done with 
    Tcl alone and it is only about 20% slower than the C-level 
    implementation. Furthermore, the Tcl implementation costed 
    about 2 days development. The C-one took 10 days. So, 
    economically speaking, the Tcl version is the clear winner. 
     
    Needles to say that a semaphore can be done in pure Tcl 
    with a mutex and a condition variable, which the threading 
    extension already supplies.  
     
    2. I will include the keyed-list datastructure in 2.6. 
     
    3. It will just have the refcount of 0 meaning that caller of 
    such "non-preserved" thread may never know wether the 
    thread is still there for the next operation. But, it will not  
    exit w/o being told so with a "thread::release" 
     
    4. I will shortly revamp the cond/mutex Tcl API support. Watch 
    for the new TIP. This way the API will be more powerful and  
    you can get many new info/statistics about the mutex etc. 
     
    5. Inherently impossible by pthread alone. 
     
    6. There is no such command in the thread package. There 
    is however thread::wait and it is described. 
     
    7. There is already thread::eval which evaluates a script under 
    the mutex, either implicit or explicit one. 
       
    8. I think that the message passing, together with channel 
    transfer and detach/attach allows one to implement almost 
    any task.  
     
    9. As a script programmer, you can safely do the "exec"  
    from the MT Tcl shell. The underlying implementation will 
    do the right thing. 
    
    
  2. login: "vasiljevic"
  3. mimetype: "text/plain"
  4. username: "vasiljevic"