[
https://jira.jboss.org/jira/browse/ISPN-318?page=com.atlassian.jira.plugi...
]
Sanne Grinovero commented on ISPN-318:
--------------------------------------
Manik, I tried some ways this weekend, but it looks like following the same strategy of
ReentrantLock.FairSync is quite hard and errorprone: to reuse the parent's code it is
a requirement that the reentrancy key is of type Thread, which is not true in
Infinispan's case, so much code needs to be written to reimplement the queue of
waiting objects. I would probably need to copy and adapt large code snippets of JVM, which
is legally not an option.
I'm also not sure if it would be ok to "park" the requesting thread, anyway
some more discussion would be required.
In my opinion you can reject this or move to future releases, I'll find a better
alternative for what I need.
Locking could optionally be "fair"
----------------------------------
Key: ISPN-318
URL:
https://jira.jboss.org/jira/browse/ISPN-318
Project: Infinispan
Issue Type: Feature Request
Components: Locking and Concurrency
Affects Versions: 4.0.0.CR3
Reporter: Manik Surtani
Assignee: Sanne Grinovero
Fix For: 4.0.0.GA
Would require a number of changes:
1. A new boolean field and getter/setter in Configuration.LockingType (follow patterns
of other boolean flags here to ensure proper XSD and parser generation), perhaps called
"useFairLocking", defaults to false.
2. Modify LockManagerImpl to pass this flag into the LockContainer implementations (in
LockManagerImpl#startLockManager())
3. Modify the 4 concrete LockContainer implementations to use this flag when creating
new locks. Implementations that use JDK reentrant locks just need to pass the fairness
flag into the ReentrantLock constructor.
4. Modify OwnableReentrantLock to handle fairness. Referring to the JDK's
ReentrantLock.FairSync may help. OwnableReentrantLock combines features of the JDK
ReentrantLock and ReentrantLock.NonFairSync into a single class, so perhaps the best
approach is to create a new OwnableFairReentrantLock.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira