14 ms·
Boy, there are a lot of negative comments here. Google is contributing to the Linux kernel and released their tool as open source. Why all the hate? Anyway, ba
by LeonM 7y ago
Boy, there are a lot of negative comments here. Google is contributing to the Linux kernel and released their tool as open source. Why all the hate?
Anyway, back on topic: would fixing these race conditions be only beneficial to stability, or would this also improve performance/responsiveness?
- deleted 7y ago[deleted]
- eloff 7y agoFixing races generally means stricter synchronization, which makes for slower code. The world is complex and there are always exceptions, but I'd expect performance to decrease. 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.
- dekhn 7y ago"brakes make my car slower, so I'd expect my average velocity to decrease if you fixed them"
- babuskov 7y agoIt's more like traffic lights being turned off.
- vanderZwan 7y agoI grew up near a city where they set up the traffic lights along one of the main roads in such a way that if you kept to the speed limit you would always arrive at the next light just after it turned green, so you never would have to brake or accelerate. I wouldn't be surprised if there are concurrency patterns analogous to that.
- dekhn 7y agosystolic matrix multiplication is roughly analogous to that. Great Highway in SF, if you drive 35MPH you will just get greens on the evenly spaced lights. The worst is when you get stuck behind a person who drives 40, then brakes heavily, then drives 40, then brakes heavily, etc.
- V-eHGsd_ 7y agothere's a 3 or 4 mile stretch of road in san francisco called the great highway that's like this (https://www.google.com/maps/@37.750302,-122.5062241,14.64z https://www.google.com/maps/@37.750302,-122.5062241,14.64z) It was one my little pleasures to drive along that at 35 (or 30, I forget what the speed limit was) and see cars zip ahead at each light at 45, only to watch them ride the brakes as they hit the next red.
- guan 7y agoWhen there’s not too much traffic, Ocean Parkway in Brooklyn also has a green wave.
- Doubl 7y agoSlow drivers must cause extreme road rage on that road
- IggleSniggle 7y agoIn my experience, it is the “fast” drivers that cause road rage by being slow. They race to the next light, stop, and because they are stopped, prevent everyone from riding the green wave because they now must accelerate from stopped. Sooooo frustrating. Just go the speed limit and none of us will need to stop you idiots! Edit: (or go double the speed limit if you must but please stop creating stops)
- Fnoord 7y agoAh yeah, groene golf (green wave [1]). I grew up remembering my parents also using that. Except it never bloody worked. [1] https://en.wikipedia.org/wiki/Green_wave https://en.wikipedia.org/wiki/Green_wave
- PyroLagus 7y agoSo lock-free datastructures such as ring buffers are like roundabouts, huh?
- chrisseaton 7y agoBut many race conditions are harmless. 'Fixing' those that are with extra synchronisation is not a good use of anyone's time.
- ggggtez 7y agoI think by definition, you are wrong. If the race condition was harmless then it wouldn't be a race condition.
- chrisseaton 7y agoBy who's definition? If you go by Padua's classic definition, it's any behaviour that depends on timing sequences. For example HN has a race condition in that the ID your comment gets allocated depends on when it's submitted. But that's not a bug, is it? It only becomes a bug when it's undesirable. I think, like a few people here, you're confusing it with a 'data race'.
- mffnbs 7y agoYou still understand, though, that the colloquial definition being used here is what you're referring to as a "data race." Your comments are disingenuous in that I believe you know that you're being pedantic, I just don't know why you've brought it up the multiple times.
- chrisseaton 7y agoI didn't realise something as specific as 'race condition' could have a colloquial definition, but ok.
- pure-awesome 7y agoFor many terms of (programming) jargon, there's a strict academic definition, perhaps as defined in a paper in which the term was originally introduced, and the usage of the word in the broader (programming) community. The latter is the colloquial definition.
- curlypaul924 7y agoI see your point, though in racing brakes make a car faster, not slower. :)
- LeonM 7y agoBrakes slow a car down in terms of velocity over time. But they may make a car faster in the sense of distance over time (aka lap times). 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>
- michalf6 7y agoYou could say that brakes make the car faster in race conditions.
- IggleSniggle 7y agoDaaaaaaaymn. Good one, holds up!
- JangoSteve 7y agoThey often are correlated though. Better brakes mean you can stay on the accelerator longer before braking, which means you usually have higher maximum velocity and faster lap times (faster lap times are literally higher average velocities, so this makes sense).
- resters 7y agoNot really, if the brakes are broken, your average will approach 0 mph after the vehicle crashes.
- mindcrime 7y ago"brakes make my car slower, so I'd expect my average velocity to decrease if you fixed them" 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.
- Craighead 7y agoThat helps that posters arguments.
- mindcrime 7y agoThat's fine by me. I don't have a dog in that fight, so to speak...
- nickserv 7y agoIndeed, disk brakes were first used on race tracks before being available on street cars.
- discreteevent 7y agoAnd some people now argue that disc brakes on road bicycles are more dangerous because you learn that you can brake later and more suddenly. I.e You will more frequently approach the limit of friction between the (very narrow) tyre and the road.
- mindcrime 7y agoI had not heard that one. I always thought the main argument against disc brakes on road bikes was they they aren't good for long descents where you're riding the brake for long periods of time... due to heat fade or whatever. Of course both things could be true...
- tryauuum 7y agoWhy are you comparing linux kernel and cars?
- StreamBright 7y agoWould you live with a less secure but faster platform rather?
- Fnoord 7y agoIt is a good question, the answer is "it depends" but usually it would be "more secure", unless you know WTF you are doing. Usually, people don't, or they think they do but they don't.
- typical182 7y agoAs far as I understand, performance is not a valid concern. 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_ONCE#performance-considerations https://github.com/google/ktsan/wiki/READ_ONCE-and-WRITE_ONC...
- eloff 7y agoYou're talking about the sanitizer performance. We were talking about the kernel performance in the real world. Fixing these race conditions will have some effect.
- rrss 7y agoNo, that page is about kernel performance, not sanitizer performance. 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.
- LeonM 7y agoWould 'stricter' mean 'more' in this context? Will the fixes consist of adding more synchronization mechanisms (mutexes, semaphores, etc) to prevent potential race conditions?
- umvi 7y agoWell, if we want true security, we need to accept that all computers must take MASSIVE performance hits. 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.
- draw_down 7y agoI’m not seeing that. Besides which, let’s stop using the word “hate” to describe any critique of something we personally view favorably.
- mrtksn 7y agohttps://xkcd.com/1172/ https://xkcd.com/1172/
- Rietty 7y agoThat is horrifying.
- burtonator 7y agoNo good deed goes unpunished. My OSS projects had a few haters recently and it's amazing the amount of vitriol you can get when you give someone something for free. I think my follow on comment is to just suggest that they fork it and maintain the project themselves.