Skip to content
Tcl Source Code History Of Ticket 872298ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 872298ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 872298ffffffffffffffffffffffffffffffffff

  1. Ticket change [2bc5aa5b61] (rid 118801) by elfring on 2004-01-07 11:25:25:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      One part of thread-safe programming is to avoid global 
      variables. But some of them must continue to exist 
      because they are essential for several functions.
      1. Can the direct access (set varname ...) be converted 
      to a function call like it is done for "errno" in C?
      
      2. How do you think about to add an option to the 
      function "http://tcl.tk/man/tcl8.4/TclCmd/global.htm"?
      global -synchronized varname ?varname ...?
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "elfring"
    9. subsystem initialized to: "49. Threading"
    10. title initialized to: "Locked access to global variables"
    11. type initialized to: "RFE"
  2. Ticket change [38b030db87] (rid 112254) by dkf on 2004-01-07 18:51:18:

    1. closedate changed to: "2004-01-07T11:51:18"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      This FRQ is invalid because Tcl and the thread extension
      already provide all the tools required.  If there is
      anything further needed, it should be prototyped within the
      context of tcllib first.  On your specific points:
      
      1) http://tcl.tk/man/tcl8.4/TclCmd/trace.htm (and there is
      an equivalent mechanism at the C level) allows all Tcl
      variable reads and writes to be trapped and clever things done.
      
      2) Global variables are just global to an interpreter
      (except for the ::env array, which is deeply magical, messy,
      and has proper locking behind the scenes IIRC.) 
      Interpreters are always single-threaded; multi-threaded Tcl
      has multiple interpreters, but each interp is constrained to
      a single thread (this is a fundamental design model thing.)
       Hence a -synchronized option is (mostly) irrelevant as all
      variable accesses are already sufficiently synchronized; the
      shared-variable stuff in the thread package (which I believe
      you already know about) is how you get variables visible
      across multiple interpreters.
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "dkf"
  3. Ticket change [0bee9d8641] (rid 114087) by elfring on 2004-01-07 19:56:02:

    1. assignee changed to: "dkf"
    2. icomment:
      Logged In: YES 
      user_id=572001
      
      Thanks for this clear answer.
      
      2) I thought that multiple threads can run in one 
      interpreter. - That's not the case at the moment.
      I know the tsv functions.
      
      I hope that the libraries I'm working with do also their job 
      with requests from different interpreters in a single process 
      without thread safety problems.
      
      
    3. login: "elfring"
    4. mimetype: "text/plain"
    5. username: "elfring"