Iso
unread,Dec 3, 2012, 3:02:37 AM12/3/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to haze...@googlegroups.com
Hi,
I have a question about the locks in Hazelcast. e.g. MapLock vs Distributed Lock
where's the difference? is there any difference in term of performance ?
for example:
1.
...
Config config = new Config();
HazelcastInstance instance = Hazelcast.newInstance(config);
map.tryLock("test", 1000, TimeUnit.MILLISECONDS);
//do something with map
map.unlock("test");
or:
2.
maplock = instance.getLock("testLock");
try {
if(maplock.tryLock(1000, TimeUnit.MILLISECONDS)){
try {
//do something with map
} finally {
maplock.unlock();
}
}
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
where is the significant difference ?
in //do somethign with map
there's only map operation no other operations will be executed
please help :)
thank u