lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Willnauer (JIRA)" <>
Subject [jira] Commented: (LUCENE-2779) Use ReadWriteLock in RAMDirectory
Date Sun, 28 Nov 2010 08:48:37 GMT


Simon Willnauer commented on LUCENE-2779:

Shai, I actually think Earwin is right with his claim that this is unneeded / pointless really.
Performance on modern JVMs is very good for both RWLock and synchronized blocks and to make
a big difference heavy contention is needed anyway. I would not expect any difference if you
are on a Java 6 JVM at all even if you'd have heavy contention. I have looked into this too
a while ago and came to the same conclusion as earwin, there seem to be no real gain in refactoring
this to use RWLocks instead fo sync blocks. 

> Use ReadWriteLock in RAMDirectory
> ---------------------------------
>                 Key: LUCENE-2779
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>            Priority: Minor
>             Fix For: 3.1, 4.0
> RAMDirectory synchronizes on its instance in many places to protect access to map of
RAMFiles, in addition to updating the sizeInBytes member. In many places the sync is done
for 'read' purposes, while only in few places we need 'write' access. So I think ReadWriteLock
can be useful.
> Also, syncing around sizeInBytes is unnecessary IMO, since it's an AtomicLong ...
> I'll post a patch shortly.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message