Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 18c1ed8f9b851c24d3bc588e77f2742d710fc659
Ticket: 674367ffffffffffffffffffffffffffffffffff
call for a function that is not thread safe
User & Date: elfring on 2003-01-24 23:39:57
Changes

  1. assignee changed to: "vasiljevic"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I describe an use case for the handling of unsafe functions calls with 
    the thread package.
    
    I must assume that an application 
    programming interface (like a graphics library or a music API) or even 
    a single function is not thread safe if this property is not described in the 
    documentation for that API.
    So I must ensure that all unsafe 
    functions are executed by a single thread at each time. I want to create a 
    thread for each function library that must be handled as it has not 
    implemented thread safety at startup/initialization time of my 
    application. I want to achieve that calls into different unsafe libraries 
    can be executed simultaneously.
    
    I can perform the call with the 
    function "thread::send" for a thread that has been created before. But I 
    think that I will need a special kind of mutual exclusion. I understand the 
    thread package's documentation in the way that a mutex that is created 
    by the command "thread::mutex create" belongs to the calling thread. 
    It may not be stored in a thread shared variable. Please correct me if I 
    make wrong assumptions here.
    
    I guess that the function 
    "thread::eval" does not all what I want and need here. It does not expect 
    a thread indentifier in its argument list.
    I need a mutex that is global to 
    the process scope 
    (http://citeseer.nj.nec.com/cs?cs=1&q=synchronization+and+global+and+mutex&submit=Documents&co=Expected+Citations&cm=50&cf=Any&ao=Expected+Citations&am=20&af=Any
    ) 
    to perform a protected and synchronous call of a code piece that 
    should be executed by an other thread.
    I would like to suggest new 
    functions like the following.
    
    1. thread::mutex::create 
    global
             or
       thread::mutex -global create
    
    2. 
    thread::safecall id global_mutex script ?varname?
    
    
    How 
    do you think about this suggestion?
    Does this use case lead to add 
    more synchronization primitives to the thread package?
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "elfring"
  9. subsystem changed to: "80. Thread Package"
  10. title changed to: "call for a function that is not thread safe"
  11. type changed to: "RFE"