344 karma · joined March 23, 2016
I picked everything up by myself later after learning computer graphics and AI, since that's when, for me, algebra and calculus became something more than a grade. Derivatives "clicked" for me because i needed to know how to calculate a root value using Newton's method.
I do lack fundamentals, and i do suffer because of that, but over the years i came to the conclusion that i won't understand something if i don't care, and that's just how things are. The education system tends to front-load theory, and i can't learn for the sake of learning. Maybe it's the same for you.
volatile's one of the simplest modifiers to understand if you care to actually learn the language. It has a clear, and well-defined purpouse, and i have no idea how you can spend so much time, and energy arguing that that's not the case.
Yes, it will! Just because you’re accessing shared variables doesn’t mean you need locks. This is what volatile is for!
You’re blindly hoping the compiler will do the right thing for you, anyway. You must have little-to-no experience writing multi-theaded code in production, let alone anything more advanced that doesn’t rely on locks.
Nobody’s arguing that volatile somehow bypasses the cache. When it comes to multithreading, that doesn’t matter though, because the whole process works with the cache, and the CPU keeps core caches synchronized. Memory barriers do nothing here.
Seriously, you’re arguing rubbish.
No amount of fences or mutexes is going to help you if threads are operating on their own version of a variable that got cached in a register, or optimised away. You need to understand volatile to write correct multi-threaded code.
That StackOverflow answer is bogus, along with all the other comments. It's just a rant that, albeit correct, is barely related to the question asked, and it's a clear example why you shouldn't treat StackOverflow as more than an unreliable help forum. The guy asked about whether you should make variables shared inside of a critical section volatile. The answer is "yes, to prevent threads from working on stale data".
Sorry, but what are you guys on about? You use "volatile" if you don't want the compiler to produce code that caches a variable. You use it all the time in embedded systems, or when writing multi-threaded code, etc. The usage of "volatile" is very clear, and should be well understood. "restrict" isn't used much because it's a c99 standard first of all, and second of all, it's like "inline"; it might make a difference, might not, and not a lot of people are in a situation where they have to shave off cycles.
IMHO it would be much more productive to tell people to be extremely sceptical towards everything they see on the internet. YouTube is very capable of launching a successful campaign to do that. I'm sure a lot of creators would jump on board, and, seeing what's most likely to go viral these days, it seems necessary. This is obviously in direct conflict with the business model of platforms like YouTube, Twitter, and Facebook, since they rely on ad ravenue, so we're stuck with orwellian solutions like the one presented.
Either way, silencing political views is like fighting fire by turning off the fire alarm. I think everybody should be worried by actions like these, because this breeds radicalism by empowering one side, and making the other side feel threatened. This isn't good for anybody.
Google can do as they please, YouTube is theirs, but you can’t seriously accept statements like these at face value.
"I love writing opinionated blog posts that make dudes go all ape shit and territorial if I didn’t do it the same way as them. Think for yourselves :) there can be more than one way ya doofuses it’s all about what your personal tradeoffs are."
Is this the kind of response you want to have to people sharing their opinions on a public forum; having a productive discussion that you started.