On Tuesday, 4 February 2014 at 21:02:37 UTC, deadalnix wrote:
Core can share a cache line in read mode, but can't in write mode.

Why not? Level 3 is shared, but it has a latency of 30-40 cycles or so.

That mean that updating the reference count will cause contention on the cache line (core will have to fight for the cache line ownership).

If they access it simultaneously and it stays in the local caches.

That is why immutability + GC is so efficient in a highly concurrent system, and ref counting would ruin that.

If you blindly use ARC rather than sane RC. There is no reason to up the ref count if the data structure is "owned" while processing it. Which is a good reason to avoid ARC and use regular RC. If you know that the entire graph has a 1+ count, you don't need to do any ref counting while processing it.

Reply via email to