Skip to content
Tcl Source Code View Ticket
Login

View Ticket

mutex-condition-3 often fails on Windows

Closed / Fixed982651f5433f677ae6937c1f6b91a3ef8fbdbba1Created 359 days agoUpdated 341 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.