Overview
| Artifact ID: | 2c16b8dcc10c0e0df04fcb5310b935a2e669da29 |
|---|---|
| Ticket: | 652530ffffffffffffffffffffffffffffffffff
Invalidated Tk_Uids |
| User & Date: | nobody on 2002-12-12 07:52:43 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- 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.
- foundin changed to: "obsolete: 8.4.1"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "49. Threading"
- title changed to: "Invalidated Tk_Uids"
- type changed to: "Bug"