Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2c16b8dcc10c0e0df04fcb5310b935a2e669da29
Ticket: 652530ffffffffffffffffffffffffffffffffff
Invalidated Tk_Uids
User & Date: nobody on 2002-12-12 07:52:43
Changes

  1. assignee changed to: "andreas_kupries"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    While playing around with Tk 8.4.1 and
    multi-threading on Win32 I observed some
    strange behaviour w.r.t. Tk_Uids:
    
    1. Tk_ConfigureWidget() converts the
    name/class/default values in the given
    Tk_ConfigSpec to UIDs.
    
    2. Tk_GetUid() installs a per-thread
    exit handler (FreeUidThreadExitProc())
    which destroys the per-thread UID
    table (and the UIDs, too) on thread
    termination, i.e. after the thread
    using Tk exited, some Tk_ConfigSpec
    fields point to free'd memory.
    
    3. When Tk is re-animated later (Tk_Init())
    in a new thread, arbitrary  Bad Things
    happen as consequence to invalidated UIDs
    from point 2.
    
    Questions:
    
    - Is it really necessary to convert
    name/class/default values to UIDs
    in Tk_ConfigureWidget ?
    
    - Is it really necessary to have a
    per-thread UID table ?
    
    --
    
    In the meantime I tried to temporarily fix it by:
    
    1. Making dbName/dbClass/defValue fields in 
    Tk_ConfigSpec to normal char pointer instead
    of Tk_Uids
    2. Using a mutex locked global (= per process)
    Uid table
    3. Making a temporary copy of the Tk_ConfigSpec
    array in Tk_ConfigureWidget
    
    See the attached patch. However, this isn't
    perfect since the TK_CONFIG_OPTION_SPECIFIED
    bit is not reflected to callers of
    Tk_ConfigureWidget for threaded builds of Tk.
    
    
  4. foundin changed to: "obsolete: 8.4.1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "49. Threading"
  10. title changed to: "Invalidated Tk_Uids"
  11. type changed to: "Bug"