Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2025-12-28
02:28 • Closed ticket [982651f543]: mutex-condition-3 often fails on Windows plus 5 ... artifact: 2278581999 user: apnadkarni
2025-12-15
08:56
(backport) Bug [982651f543] - Remove test for mutex thread fairness as not guaranteed by OS. Timeout... check-in: 4cbb008880 user: jan.nijtmans tags: core-9-0-branch
2025-12-14
15:44 • Ticket [982651f543] mutex-condition-3 often fails on Windows status still Op... artifact: 090a934384 user: apnadkarni
15:42
Bug [982651f543] - Remove test for mutex thread fairness as not guaranteed by OS. Timeouts suffice t... check-in: db598cbe2f user: apnadkarni tags: trunk, main
15:16 • Ticket [982651f543] mutex-condition-3 often fails on Windows status still Op... artifact: 0aa9d6ba85 user: apnadkarni
2025-12-09
08:41 • Ticket [982651f543]: 3 changes artifact: 05220aa60b user: jan.nijtmans
08:41 • New ticket [982651f543]. artifact: 6c3649aaea user: jan.nijtmans

mutex-condition-3 often fails on Windows

Closed / Fixed982651f5433f677ae6937c1f6b91a3ef8fbdbba1Created 359 days agoUpdated 340 days ago
Descriptionwiki2025-12-09 08:41:13
Examples:

* https://github.com/tcltk/tcl/actions/runs/20001593544/job/57357640381

* https://github.com/tcltk/tcl/actions/runs/20021820910/job/57410165607

Those are the Windows builds on December 7 and 8

I don't think there's something wrong with mutexes on Windows (at least not with the Tcl wrappers around the Windows API). But this testcase tests a OS implementation, whether it assigns time reasonably between threads. Tcl should not test that, it's not Tcl's responsibility, therefore I suggest to mark this testcase as "nonPortable"

Referenced by2
  • 4cbb008880(backport) Bug [982651f543] - Remove test for mutex thread fairness as not guaranteed by OS. Timeouts suffice to ensure no deadlocks. check-in2025-12-15 08:56:48
  • db598cbe2fBug [982651f543] - Remove test for mutex thread fairness as not guaranteed by OS. Timeouts suffice to ensure no deadlocks. check-in2025-12-14 15:42:57
jan.nijtmans Ticket [982651f543]: 3 changes [History diff]2025-12-09 08:41:25
apnadkarnimarkdown2025-12-14 15:16:06

You're right in that the Microsoft documentation explicitly says there are no guarantees as to the threads that are woken up and granted the lock. And if the last run thread is the winner more often than not, it's possible the "fairness" test will fail.

What I was trying to ensure for the most part that no thread gets permanently blocked. Let me see if there is a better way to verify that. Until then, I'll mark it as nonPortable.

apnadkarniplain2025-12-14 15:44:39
Removed the fairness check as the timeout counts are suffice to track deadlocks. Keeping open until CI runs.
apnadkarni Closed ticket [982651f543]. [History diff]2025-12-28 02:28:10
Log in (anonymous is fine) to add a comment.