Posted By:
Jiho_Park
Posted On:
Tuesday, February 13, 2001 08:07 PM
In java.util.Hashtable, put, get method is implemented using "synchrozied". In my program... there is only one hashtable, and many threads access this hashtable at the same time. (thread use put, get method) My question is... put, get method is already synchronized... then need I use synchronized when thread call hashtable's put, get method? (i.e.) in Thread // h is Hashtable ........ ........ synchronized (lock) { // --> Need I use this ???? h.put("one", new Integer(1)); }
More>>
In java.util.Hashtable,
put, get method is implemented using "synchrozied".
In my program...
there is only one hashtable,
and many threads access this hashtable at the same time.
(thread use put, get method)
My question is...
put, get method is already synchronized...
then need I use synchronized when thread call hashtable's put, get method?
(i.e.)
in Thread
// h is Hashtable
........
........
synchronized (lock) { // --> Need I use this ????
h.put("one", new Integer(1));
}
<<Less