3 ms·
Well yes and no. In the multi-threaded case you'd use ARC (atomic reference count) pointers. These use atomic instructions to increment and decrement references
by openasocket 10y ago
Well yes and no. In the multi-threaded case you'd use ARC (atomic reference count) pointers. These use atomic instructions to increment and decrement references, and are thus lock-free. There's still contention, but only on the data bus and the cache coherency protocol for the atomic instructions. Under contention, you're looking at latency for access less than 80-100ns. Of course, if all of these threads are accessing an object at once you're going to have contentions no matter what, unless all of the threads are read-only.