by LeonM · 7y ago · 0 comments
Anyway, back on topic: would fixing these race conditions be only beneficial to stability, or would this also improve performance/responsiveness?
Edit: it goes without saying, but it's much better to fix the race conditions, regardless of what it means for performance. Some people seem to think I'm advocating for not fixing them.
For example, from dvyukov's KTSAN wiki [1]:
Given a sufficiently expressive atomic API and a good
implementation, you pay only for what you really need (if
you pay just a bit less, generated code becomes incorrect).
So performance is not an argument here.
[1] https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONC...The idea is that if you omit READ_ONCE/WRITE_ONCE when they are needed, it doesn't matter if the code is faster because it is wrong.
Just to be pedantic... in some contexts better brakes actually allow you to go faster. Consider racing on an oval track... a car with better braking ability can maintain speed longer as it approaches a corner, then scrub off speed more quickly to navigate the corner. A car with inferior brakes has to start slowing down sooner or risk crashing by taking the corner too fast. So better brakes can lead directly to faster lap times.
Yes, and in other contexts, better brakes make you go slower. Better brakes means bigger brakes: larger rotors (discs), larger and heavier calipers, etc. Larger brake rotors take more energy to accelerate (they're basically a bigger flywheel), so they decrease the car's acceleration. So if your goal is to have a car that accelerates as fast as possible, better brakes are actually a big detriment.
Some drivers have complained about rain because the tears have been literally pulled out of them under the deceleration
I guess the real issue here is that 'fast' is ambiguous. In terms of racing it can be used for both lap-times or velocity. lap-times and maximum velocity are not necessarily correlated.
</nerdsnipe>
[1] these sort of assumptions of course tend not to age well.
It's the price to be paid for security. No more branch prediction, no more cutting corners with UB. It's time to do things the right way once and for all and that means setting back performance a good 10-20 years.
Will the fixes consist of adding more synchronization mechanisms (mutexes, semaphores, etc) to prevent potential race conditions?
I think my follow on comment is to just suggest that they fork it and maintain the project themselves.