Re:The case of the critical section that let multiple thread...
by Wumpnot on Sunday March 23, 2025 @10:17AM
(#43453096)
In some rare cases you can get an exclusive lock when you asked for a shared lock, most code won't care and will still work correctly, but sometimes people do weird shit that they probably should have used a different construct for, and run into this.
[ Parent
| on HN ]
Re:The case of the critical section that let multiple thread...
by colonwqbang on Sunday March 23, 2025 @06:01PM
(#43456242)
The point of an RW lock is that it supports multiple concurrent readers. Why is it weird to expect a non exclusive lock operation to be non exclusive?
Re:The case of the critical section that let multiple thread...
by tialaramex on Monday March 24, 2025 @12:34PM
(#43462881)
It's fair to say that most people can't hit this bug, or rather, they can't hit the grave consequence (a deadlock). To deadlock you need to specifically need shared access when you asked for shared access. A lot of people have code where they want shared access for improved performance, but they don't need it. This bug makes their code a tiny bit slower in some edge cases (where it took the wrong lock), they're not overjoyed about the bug but it has no significant consequences.