A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
Java in General
Author
How to synchronize HashMap
Vinney Shanmugam
Ranch Hand
Joined: Aug 27, 2008
Posts: 104
posted
May 14, 2010 03:14:08
0
I did get a question from one of my colleauge that " How to synchronize a
HashMap
? "
The reply was access your
HashMap
from within a Synchronized method.
Is it correct?
Istvan Kovacs
Ranch Hand
Joined: May 06, 2010
Posts: 100
posted
May 14, 2010 03:38:34
0
Check methods of
java.util.Collections
(the class, not the Collection interface) for an answer.
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
4
posted
May 14, 2010 03:44:01
0
That's one way to do it.
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: How to synchronize HashMap
Similar Threads
Locking strategy
Java Clarifications..help needed
How synchronize between Threads ?
HashMap, lock + unlock
Implementing Lock/Unlock
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter