This is a followup question to: http://stackoverflow.com/questions/3077703/java-serialization-of-objects-in-a-multithreaded-environment.
Suppose I have a collection of objects that are always acted upon by multiple threads.
public class AlwaysChanging implements Serializable {
// ... state ...
public synchronized void updateFromThread1( int data ) { /* ... */ }
public synchronized void updateFromThread2( int data ) { /* ... */ }
}
What is a safe way to serialize a Collection<AlwaysChanging>
?