G
Guest
Hi,
I have one thread adding objects to a hashtable, and a bunch of other
threads doing reads. MSDN says that multiple threads doing reads is safe.
My question, is if my write thread is only adding new buckets to the
hashtable, then there should not be a conflict w/ any other threads? Maybe
the add() method somehow modifies the general state of the hashtable during
the call, making it unsafe to read at that time. The bottom line is, does
anyone know if I have to lock the add() operation? I do not want to do this
if it is unnecessary.
Thanks in advance!
Yuri
I have one thread adding objects to a hashtable, and a bunch of other
threads doing reads. MSDN says that multiple threads doing reads is safe.
My question, is if my write thread is only adding new buckets to the
hashtable, then there should not be a conflict w/ any other threads? Maybe
the add() method somehow modifies the general state of the hashtable during
the call, making it unsafe to read at that time. The bottom line is, does
anyone know if I have to lock the add() operation? I do not want to do this
if it is unnecessary.
Thanks in advance!
Yuri