RAII for shared resources also induces cache problems if not implemented with lock free algorithms, which are quite hard to get right without some GC help.
There is also the issue for cyclic data structures and a stop the world effect when destroying big data structures.
Personally, I favour GC with (with/using/defer/scope) than pure RAII and was a bit disappointed that the C+11 GC API proposal was just partially adopted into the standard.
Combining RAII and GC (explicitly choosing what to use for various data) can be an interesting hybrid approach. Looks like Rust does exactly that, allowing you to explicitly define which data is garbage collected (while the rest is handled with standard RAII):
RAII for shared resources also induces cache problems if not implemented with lock free algorithms, which are quite hard to get right without some GC help.
There is also the issue for cyclic data structures and a stop the world effect when destroying big data structures.
Personally, I favour GC with (with/using/defer/scope) than pure RAII and was a bit disappointed that the C+11 GC API proposal was just partially adopted into the standard.