|
|
|
|
|
by vlovich123
295 days ago
|
|
> Concurrency requires locks. Arc<T> is a global lock on references Concurrency does not require locks. There’s entire classes of lock free and wait free algorithms. Arc<T> is also not a lock - it uses atomics to manage the reference counts and no operation on an Arc needs to wait on a lock (it is a lock-free container). > “A lot” of Java objects don’t use synchronized. I’d even bet that 95-99% of them don’t. Almost all objects that are used in a concurrent context will likely feature synchronized, at least historically. That’s why Hashtable was split into HashMap (unsynchronized) and ConcurrentHashMap (no longer using synchronized). Thats why you have StringBuffer which was redone into StringBuilder. |
|