Synchronization
Java has the legacy of the classic collections (Hashtable, Vector, and so forth) and the new collections that were introduced in Java 1.2 (HashMap, ArrayList, and so forth). Although some implementation differences exist, the main change was that none of the methods in the new collections are synchronized, but the classic collections are all thread-safe.
.NET has a different approach to thread-safe collections. All of the concrete classes contained in the System.Collections namespace are concurrently safe for multiple readers and a single writer. Multiple concurrent writers will cause problems.
A synchronized (thread-safe) implementation of a concrete collection can be obtained by calling the Synchronized method, which returns a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access