3 ms·
Yes, but the number of things you want to synchronize on in real-life code is limited, and, certainly at the time, memory was scarce. I think only allowing ‘syn
by Someone 4y ago
Yes, but the number of things you want to synchronize on in real-life code is limited, and, certainly at the time, memory was scarce. I think only allowing ‘synchronized’ on containers and allowing programmers to opt-in on them would have been the better choice.
> Plus an inherent assumption of mutable data.
Yet, Strings and the boxed value types (Integer, Long, etc.) are immutable, and you can synchronize on them (or does this matter less for those because of the granularity of the memory allocator?)
- paulddraper 4y ago> Strings and the boxed value types (Integer, Long, etc.) are immutable, and you can synchronize on them Side note: That is a very bad idea, because their object identity is iffy.
- deleted 4y ago[deleted]