From: Wolfgang M. M. <wol...@us...> - 2004-06-08 08:16:23
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29485/src/org/exist/util Modified Files: ReentrantReadWriteLock.java MultiReadReentrantLock.java Log Message: * Resolved concurrency conflicts when accessing a collection: avoid dirty reads on the old document while it is being replaced. * The index settings specified in the configuration are now also applied to reindexed document fragments during an XUpdate. * Removed unnecessary data from org.exist.dom.DocumentImpl to reduce its in memory size. * Deferred addition of new documents to collection: when adding a large number of documents, keeping the actual document objects in memory slows down the indexing process. Class Collection now just remembers the document name, not the object itself. Index: MultiReadReentrantLock.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/util/MultiReadReentrantLock.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MultiReadReentrantLock.java 2 Jun 2004 11:34:34 -0000 1.1 --- MultiReadReentrantLock.java 8 Jun 2004 08:16:14 -0000 1.2 *************** *** 74,78 **** * ensure that write locks are issued in the same order they are requested. */ ! private List waitingForWriteLock = new ArrayList(5); /** Default constructor. */ --- 74,78 ---- * ensure that write locks are issued in the same order they are requested. */ ! private List waitingForWriteLock = null; /** Default constructor. */ *************** *** 141,144 **** --- 141,146 ---- // log.debug("nested write lock: " + outstandingWriteLocks); // } + if(waitingForWriteLock == null) + waitingForWriteLock = new ArrayList(3); waitingForWriteLock.add(thisThread); } *************** *** 198,202 **** // could pull out of sub if block to get nested tracking working. ! if (outstandingReadLocks == 0 && waitingForWriteLock.size() > 0) { writeLockedThread = (Thread) waitingForWriteLock.get(0); // if ( log.isDebugEnabled() ) --- 200,204 ---- // could pull out of sub if block to get nested tracking working. ! if (outstandingReadLocks == 0 && waitingForWriteLock != null && waitingForWriteLock.size() > 0) { writeLockedThread = (Thread) waitingForWriteLock.get(0); // if ( log.isDebugEnabled() ) *************** *** 246,250 **** outstandingReadLocks--; if (outstandingReadLocks == 0 && writeLockedThread == null && ! waitingForWriteLock.size() > 0) { writeLockedThread = (Thread) waitingForWriteLock.get(0); // if ( log.isDebugEnabled() ) --- 248,252 ---- outstandingReadLocks--; if (outstandingReadLocks == 0 && writeLockedThread == null && ! waitingForWriteLock != null && waitingForWriteLock.size() > 0) { writeLockedThread = (Thread) waitingForWriteLock.get(0); // if ( log.isDebugEnabled() ) *************** *** 270,274 **** public synchronized boolean isLockedForWrite() { ! return writeLockedThread != null || waitingForWriteLock.size() > 0; } } --- 272,276 ---- public synchronized boolean isLockedForWrite() { ! return writeLockedThread != null || (waitingForWriteLock != null && waitingForWriteLock.size() > 0); } } Index: ReentrantReadWriteLock.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/util/ReentrantReadWriteLock.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ReentrantReadWriteLock.java 2 Jun 2004 11:34:34 -0000 1.4 --- ReentrantReadWriteLock.java 8 Jun 2004 08:16:14 -0000 1.5 *************** *** 28,32 **** protected long holds_ = 0; protected int mode_ = Lock.READ_LOCK; ! private long timeOut_ = 60000L; public ReentrantReadWriteLock(String id) { --- 28,32 ---- protected long holds_ = 0; protected int mode_ = Lock.READ_LOCK; ! private long timeOut_ = 240000L; public ReentrantReadWriteLock(String id) { |