4 ms·
Prohibitively? That really depends on your use case. OpenSceneGraph [1] uses intrusive reference counting pointers yet has been found suitable for many real ti
by McP 13y ago
Prohibitively? That really depends on your use case.
OpenSceneGraph [1] uses intrusive reference counting pointers yet has been found suitable for many real time applications.
[1] http://en.wikipedia.org/wiki/OpenSceneGraph http://en.wikipedia.org/wiki/OpenSceneGraph
- pron 13y agoProhibitive for the very data structures that make true many-core scaling possible and that necessitate a GC in the first place. A CAS on every pointer copy could obliterate your scaling. This kind of technique was fine in the good-old one- or two-core days. It won't cut it now - not if you want to scale. Nothing about modern hardware is the same as it used to be. I strongly recommend watching this extremely enlightening talk by Doug Lea about designing multi-threaded algorithms (http://emergingtech.chariotsolutions.com/2013/04/phillyete-screencast-7-doug-lea-engineering-concurrent-library-components/ http://emergingtech.chariotsolutions.com/2013/04/phillyete-s...). For example, did you know that in order for a busy-wait (spin loop) to be effective on modern intel CPUs, it has to compute random numbers (otherwise, the CPU might think you're in the OS idle-loop and power-down the core)?
- acqq 13y agoThanks for Doug Lea's presentation, I'll try to produce presentation from the video using ffmpeg. The sound is... unpleasant. Regarding CAS on every pointer copy, it's true that the current hardware has problem with it. Still I wonder if it would be worth and enough to optimize some future CPU to speed up the "interlocked increments" and "interlocked decrements" by introducing delays only to the cores that "interockedly" access the same addresses? I guess it can be tricky as one core has a lot of "in-flight" memory operations at the same tick, but I don't know the real limitations or if there's something more I'm missing, anybody reading this who knows more, what are the limitations?