Such a quaint throwback!
〝volatile: The Multithreaded Programmer's Best Friend〞 — @incomputable
I'd forgotten how wild C++ was before C++11.
Don't do what the article says! An article from another era.
http://www.drdobbs.com/cpp/volatile-the-multithreaded-programmers-b/184403766 …
-
-
peek and poke are library functions or just use asm. I've written a ton of microcontroller code and there is zero sense in pretending that code accessing memory-mapping i/o is portable
-
Except all the modern mmio drivers in Linux *just work* on all archs, even ones they were never designed for. Essentially, they *are* portable. This was not the case with old io-insn stuff.
-
Yes you could achieve the same with peek and poke functions for each bus access size, but unless they were part of the stdlib you'd have all sorts of gratuitous portability problems from ppl implementing their own just for arm and x86.
-
maybe we should quibble about a specific piece of code-- do you have one in mind? my guess is that the implementation style is already pretty close to what I want. all I'm really talking about is replacing x = 1 where x is volatile with poke(x, 1).
-
Oooh let's put that on
@cpp_rates !
End of conversation
New conversation -
-
-
No need for asm, they'd be intrinsics. Way cheaper than a type qualifier - no comparison really.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.