4 ms·
Concurrency is bug-prone. Complex code is bug-prone. glibc's CV implementation combines both. In my experience, both writing and teaching concurrency, there's
by userbinator 4y ago
Concurrency is bug-prone. Complex code is bug-prone. glibc's CV implementation combines both.
In my experience, both writing and teaching concurrency, there's a very strong sentiment of "I'll just use another CV/lock/etc." whenever people encounter a bug and try to fix it, which seldom fully solves the problem but usually makes it even more subtle and compounds the number of resulting states.
One of my tricks to increase chances for race conditions and deadlocks when testing is to use a modified sampling profiler to randomly delay and pause threads, but with such a long sequence of steps as this bug requires, that would've been unlikely to help. Yet Murphy's Law says that it will happen in practice...