| ▲ | kouteiheika 3 hours ago | ||||||||||||||||||||||
Well, basically, yeah, if your platform lacks support for atomics, or if you'd need some extra functionality around the shared pointer like e.g. logging the shared pointer refcounts while enforcing consistent ordering of logs (which can be useful if you're unfortunate enough to have to debug a race condition where you need to pay attention to refcounts, assuming the extra mutex won't make your heisenbug disappear), or synchronizing something else along with the refcount (basically a "fat", custom shared pointer that does more than just shared-pointering). | |||||||||||||||||||||||
| ▲ | colonwqbang 2 hours ago | parent [-] | ||||||||||||||||||||||
Does there exist any platform which has multithreading but not atomics? Such a platform would be quite impractical as you can't really implement locks or any other threading primitive without atomics. | |||||||||||||||||||||||
| |||||||||||||||||||||||