B
bernardpace
Hi,
Using the following code
Hashtable myData = Hashtable.Synchronized(new Hashtable());
Then I will be having a main thread that will write to this hashtable,
and other n threads that will read and write to this hashtable. In the
n threads, when reading and writing, only one thread will be assigned
specifically on place in the hashtable.
Thread 1 will access only data in myData[1]
Thread 2 will access only data in myData[2]
Thread 3 will access only data in myData[3]
....
Having this scenario, is there need to use the lock(this){...}
mechanism on the Hashtable.
Can someone help me out
Thanks in Advance
Using the following code
Hashtable myData = Hashtable.Synchronized(new Hashtable());
Then I will be having a main thread that will write to this hashtable,
and other n threads that will read and write to this hashtable. In the
n threads, when reading and writing, only one thread will be assigned
specifically on place in the hashtable.
Thread 1 will access only data in myData[1]
Thread 2 will access only data in myData[2]
Thread 3 will access only data in myData[3]
....
Having this scenario, is there need to use the lock(this){...}
mechanism on the Hashtable.
Can someone help me out
Thanks in Advance