Earlier quoted context omitted.
MESI cache coherency (and its derivatives) [1] means that you can have exclusive writes to cache if and only if no other core tries to access that data. I would think most if not all microarchitectures have moved to MESI (or equivalent) cache coherency protocols as they avoid unnecessary writes to memory. [1]: https://en.wikipedia.org/wiki/MESI
Sure, but for shared objects you can’t allow data races.
The Garbage Collection Handbook, 2nd Edition
171–174 of 174 posts
Re: The Garbage Collection Handbook, 2nd Edition
#172Earlier quoted context omitted.
If you write to cache, then depending on architecture that change has to be made visible to every other thread as well. Reading is not subject to such a constraint.
Only for atomics. Single-threaded RC counts are fine and WebKit uses hybrid RC where you use an atomic shared ptr to share across threads and then you downgrade it to a non atomic version in-thread (and can hand out another atomic copy at any time). Atomics are rarely needed as you should really try to avoid sharing ownership across threads and instead change your design to avoid that if you can.
> Only for atomics
I don't think cache coherency is aware of threads; they live at a level above it (IANAExpert though)
> where you use an atomic shared ptr to share across threads and then you downgrade it to a non atomic version in-thread (and can hand out another atomic copy at any time).
your idea of GC is very different from others', you are happy to do a ton of manual stuff. GC is generally about not doing a ton of manual stuff.
Re: The Garbage Collection Handbook, 2nd Edition
#173What I really want out of a garbage collector is a "Collect" function with a deadline. Pick a max time it's allowed to run before stopping and returning to the program.
Re: The Garbage Collection Handbook, 2nd Edition
#174Earlier quoted context omitted.
> Many great programmers hold the opinion that Java is horrible. Could you name a few?
Linus, Dijkstra, Stroustrup, to name a few. Time has shown OOP is not good.
I wouldn't take Linus' hyperbole at face value, given that he is a guy who has consistently refused to use anything but C or assembly.
Dijkstra, on the other hand, argued that Haskell should be taught in college instead of Java. Yeah, let's go with that.
> Stroustrup
> Time has shown OOP is not good.
So, the creator of C++ argues that OOP is "not good"?
OOP is ubiquitous, and a fine tool. Plainly saying that it is "not good" is like saying nothing.