freenode/#sicl - IRC Chatlog
Search
19:49:49
Bike
https://gist.github.com/Bike/e587d9f6dcfb4c50936d61c4bc150398 i wrote out (much of) how i'd explain atomics but it's more like a tutorial than a standard, so i'll have to pare that down
4:16:16
Bike
unfortunately, after a while this results in diagrams like these https://cdn.discordapp.com/attachments/390697866055647242/803840415941001236/c11.png
4:18:36
Bike
They're diagrams of possible executions (i.e. happens-before total orders) for simple C programs. I think the black lines are happens-before, and the colored lines relate to orderings of reads and writes that you have to deal with if you use atomics.
4:19:16
Bike
Incidentally, apparently hans "garbage collector" boehm is heavily involved in the C++ standards discussions of this stuff. that's kind of interesting
4:21:59
Bike
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0668r4.html or at least here he is. some of this stuff is still an open research area, at least as relates to like, formal verification.
4:24:44
Bike
actually in another tab i have a paper open that mentions interaction between this stuff and garbage collectors
4:25:20
Bike
"[...] a similar capability will likely be needed by any C++ garbage collector. Furthermore, garbage collectors enable use cases that are quite similar to those of [read copy update]"
4:25:57
Bike
But I will be interested to see if they're concerns for garbage collection more generally. In multithreaded environments anyway.
4:27:44
Bike
Most of the complicated stuff comes in when you give up sequential consistency, which apparently really does help performance sometimes. But probably if the main concern is correctness one can just stick with sequential consistency.
4:30:15
beach
So, in summary, in order to make C++ as fast as possible while still having a well-defined memory model, they need to make that memory model extremely complicated. At the same time, their exception system is broken, so can't really be used by application code, and the fact that they still stipulate manual memory management means that they can't write programs that are both modular and fast.
4:32:01
beach
Oh, and at the same time, the world's most popular programming language is Python, which is at least an order of magnitude slower than any naive Common Lisp implementation.