sijie commented on issue #1284: Improve FileInfoBackingCache
URL: https://github.com/apache/bookkeeper/pull/1284#issuecomment-375752857
 
 
   @ivankelly 
   
   > it seems pointless to have locks around a concurrent hashmap
   
   well. depends on how you see stuffs. concurrent hashmap is section based 
implementation, it has better parallelism and less contention on accessing 
stuffs. especially most of the time the map is protected under a read lock and 
only be blocked when the map is going to modified.
   
   > I've made a PR into your branch with a lockless approach.
   
   I have thought about lockless approach but I didn't do it. A lockless 
approach moves the mutation out of the protected of a write lock, which can 
potentially make it exposed to race conditions that we don't think of. This 
area has been very tricky based on the PRs and discussions we had around it. It 
is a too-risky change for me. That's also the reason I explained above and the 
reason I don't feel comfortable about your lockless change.
   
   My immediate concern is only "don't do IO under one lock". I am much 
comfortable to keep the read/write lock until there is an evidence showing 
read/write lock is a problem.

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


With regards,
Apache Git Services

Reply via email to