Sam,

[email protected] wrote
> Is there any other way to take a distributed lock which can be unlocked by
> owner thread, but does not need same LOCK instance? I mean unlock api
> finds and gets the lock instance automatically to unlock. I am not sure if
> IgniteLock can do that, not yet tried.

The answer is no. As I said, Ignite locks replicate the semantics of Java
locks. Why do you need different behavior?


[email protected] wrote
> 1. Is there any atomic api which can be used as fetchAndLock and
> putAndUnlock?

Use transactions for this. fetchAndLock is actually a transactional get().




[email protected] wrote
> 2. Is there concept of locking Key and locking cached entry? here is my
> understanding on difference between them -
> - Locking key - Distributed lock. Does not need existence of cache entry
> with that key. 
> - Locking Entry - Distributed lock. To lock entry, it need to exists in
> cache. Once locked all other thread access are read only.  

Current locks are exclusive, but there is a ticket in progress for
read-write lock: https://issues.apache.org/jira/browse/IGNITE-637. However,
I believe it will not depend on value existence. And again, I'm not sure I
understand a use case where it can be needed.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/understanding-Locks-usage-tp7489p7593.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to