mnpoonia commented on issue #1407: HBASE-24099 Use a fair 
ReentrantReadWriteLock for the locks used to guard region closing and updates
URL: https://github.com/apache/hbase/pull/1407#issuecomment-607798788
 
 
   In general, fair ReentrantReadWrite local has a performance equivalent to 
synchronized block. So we will be taking quite a hit here. 
   Another thing that i found in jdk doc is that
   
   > Note that the non-blocking ReentrantReadWriteLock.ReadLock.tryLock() and 
ReentrantReadWriteLock.WriteLock.tryLock() methods do not honor this fair 
setting and will acquire the lock if it is possible, regardless of waiting 
threads.
   
   I hope it is only related to tryLock and not normal lock() method. but need 
to check otherwise we are out of luck here.
   
   Also we can add log for the number of threads waiting in queue before this 
thread. This should be pretty safe since it is inside close and will not be 
called many times but will help us in debugging.
   
   
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html#getQueueLength--

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to