Overview
| Artifact ID: | 12a35d6775709ac77ae50b9e63b144bc78a1af8856d38310b1273fd0abead74a |
|---|---|
| Ticket: | 893f8cc5db3ba8bd6bed80ce89a0a75c6088a37c
Nested mutexes following TIP 509 |
| User & Date: | oehhar on 2025-08-22 17:15:22 |
Changes
- comment changed to:
As reported by Christian and Sergey, nested mutexes following TIP 509 are broken. Christian has provided the fix by a core list message titled Re: "[TCLCORE] Review of branch bug-87b69745be" 2025-08-13 17:50 UTC. This fix is now in commit [cdc8e88f7b], which starts branch [893f8cc5-tip509-nested-mutex]. <h2>Here are additional informations given in the thread by Christian</h2> For the record: the Win32 implementation of wait on condition seems broken, too. Due to Win32 critical sections supporting nesting, the logical unlock before the wait on condition *must* leave the critical section as many times as it was entered and restore this afterwards. Otherwise the mutex is locked during the wait, and that violates the contract. Note, that the used wall clock has issues, and eventually TIP 509: Now we have the "wait on condition" operation, which in the POSIX sense can be timely limited to an absolute point of time, when it is to time out. Why the heck you might ask? Dude, due to the spuriously wakeupery, when you've raced and won not. This is not reflected in any current implementation <h2>Ashok</h2> I agree your fix, along with the system encoding MT issue Sergey logged, is something that needs attention. Whether that means eliminating the recursive mutex or fixing the condition variable code remains to be seen. While I am wary of the former in a non-major release, since the API is new in Tcl 9, it is likely few people will be using it so reverting may be a possibility. As to the time frame, hopefully in a couple of weeks unless someone gets to it sooner. of the Tcl wrappers. And the fine problem in POSIX was, that absolute meant wall clock in the early days. Until POSIX condition variables learned about CLOCK_MONOTONIC. Which IMO is the only usable way to operate "waiting on condition". Since wall clockery might do things under the hood and out of control.
- login: "oehhar"
- mimetype: "text/plain"