Hi, I am a bit confused over what is being Thread Safe. Suppose I have a multi threaded program accessing a Hashtable, when thread A is accessing the hashtable, thread B can also access it and corrupt the data. Is this what is called not being Thread Safe ?? If I make the hashtable synchronized, that makes it Thread Safe, am I right ?? Thanks in advance. Sim Sim.
posted 14 years ago
Yes, but strictly speaking only methods and blocks can be synchronized. Sun has a link on synchronizing threads. Another good link is artima.com.