river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter_firmst...@apache.org
Subject svn commit: r1542458 - in /river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini: fiddler/FiddlerImpl.java mercury/MailboxImpl.java norm/PersistentStore.java
Date Sat, 16 Nov 2013 03:34:02 GMT
Author: peter_firmstone
Date: Sat Nov 16 03:34:01 2013
New Revision: 1542458

URL: http://svn.apache.org/r1542458
Log:
Update all instances of ReadersWriter to use ReadersPriorityWriter.

ReadersPriorityWriter implementation is very similar to it's parent class ReadersWriter, however
it utilizes Java 5 explicit locking and conditions to avoid waking all reader and writer threads,
when only a writer can obtain the lock.  This avoids warm reader threads from repeatedly synchronizing
on the object lock, causing contention delays for the writer trying to obtain a write lock.

Modified:
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/fiddler/FiddlerImpl.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mercury/MailboxImpl.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/norm/PersistentStore.java

Modified: river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/fiddler/FiddlerImpl.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/fiddler/FiddlerImpl.java?rev=1542458&r1=1542457&r2=1542458&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/fiddler/FiddlerImpl.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/fiddler/FiddlerImpl.java Sat Nov 16
03:34:01 2013
@@ -37,6 +37,7 @@ import com.sun.jini.start.LifeCycle;
 import org.apache.river.api.util.Commission;
 
 import com.sun.jini.thread.InterruptedStatusThread;
+import com.sun.jini.thread.ReadersPriorityWriter;
 import com.sun.jini.thread.ReadersWriter;
 import com.sun.jini.thread.ReadersWriter.ConcurrentLockException;
 import com.sun.jini.thread.ReadyState;
@@ -279,7 +280,7 @@ class FiddlerImpl implements ServerProxy
     private final SnapshotThread snapshotThread;
 
     /** Concurrent object to control read and write access */
-    private final ReadersWriter concurrentObj = new ReadersWriter();
+    private final ReadersWriter concurrentObj = new ReadersPriorityWriter();
     /** Object for synchronizing with the registration expire thread */
     private final Object leaseExpireThreadSyncObj = new Object();
     /** Object on which the snapshot-taking thread will synchronize */

Modified: river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mercury/MailboxImpl.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mercury/MailboxImpl.java?rev=1542458&r1=1542457&r2=1542458&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mercury/MailboxImpl.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mercury/MailboxImpl.java Sat Nov 16
03:34:01 2013
@@ -39,6 +39,7 @@ import com.sun.jini.reliableLog.LogHandl
 import com.sun.jini.start.LifeCycle;
 import org.apache.river.api.util.Commission;
 import com.sun.jini.thread.InterruptedStatusThread;
+import com.sun.jini.thread.ReadersPriorityWriter;
 import com.sun.jini.thread.ReadersWriter;
 import com.sun.jini.thread.ReadersWriter.ConcurrentLockException;
 import com.sun.jini.thread.ReadyState;
@@ -273,7 +274,7 @@ class MailboxImpl implements MailboxBack
     /** The admin proxy of this server */
     private /*final*/ volatile MailboxAdminProxy mailboxAdminProxy;
     /** Concurrent object (lock) to control read and write access */
-    private final ReadersWriter concurrentObj = new ReadersWriter();
+    private final ReadersWriter concurrentObj = new ReadersPriorityWriter();
     /** Map from <code>Uuid</code> to <code>ServiceRegistration</code>
*/
     // HashMap is unsynchronized, but we are performing external
     // synchronization via the <code>concurrentObj</code> field. 

Modified: river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/norm/PersistentStore.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/norm/PersistentStore.java?rev=1542458&r1=1542457&r2=1542458&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/norm/PersistentStore.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/norm/PersistentStore.java Sat Nov
16 03:34:01 2013
@@ -31,6 +31,7 @@ import com.sun.jini.norm.lookup.SubStore
 import com.sun.jini.reliableLog.LogHandler;
 import com.sun.jini.reliableLog.ReliableLog;
 import com.sun.jini.system.FileSystem;
+import com.sun.jini.thread.ReadersPriorityWriter;
 import com.sun.jini.thread.ReadersWriter;
 
 /**
@@ -57,7 +58,7 @@ class PersistentStore {
      * snapshot thread the writer since for us mutation is the
      * non-exclusive operation.
      */
-    final private ReadersWriter mutatorLock = new ReadersWriter();
+    final private ReadersWriter mutatorLock = new ReadersPriorityWriter();
 
     /**
      * Thread local that tracks if (and how many times) the current thread



Mime
View raw message