N
Nic
The documentation for most collection classes state that
public static members are thread safe, but to what extent
can a collection be accessed safely via multiple threads
calling non static methods if the collection is not
changed (written) by any other thread?
E.g. when using either a Hashtable or an ArrayList with
fixed contents (not changed during the test), I seem to
be able to safely read from them via multiple threads
without any synchronisation. Given a collection with
fixed contents, are multiple readers thread safe even
though the read operations call non static methods?
Thanks for any help
Nic.
public static members are thread safe, but to what extent
can a collection be accessed safely via multiple threads
calling non static methods if the collection is not
changed (written) by any other thread?
E.g. when using either a Hashtable or an ArrayList with
fixed contents (not changed during the test), I seem to
be able to safely read from them via multiple threads
without any synchronisation. Given a collection with
fixed contents, are multiple readers thread safe even
though the read operations call non static methods?
Thanks for any help
Nic.