Class WriterPreferenceReadWriteLock

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public class WriterPreferenceReadWriteLock
    extends java.lang.Object
    implements ReadWriteLock
    A ReadWriteLock that prefers waiting writers over waiting readers when there is contention. This class is adapted from the versions described in CPJ, improving on the ones there a bit by segregating reader and writer wait queues, which is typically more efficient.

    The locks are NOT reentrant. In particular, even though it may appear to usually work OK, a thread holding a read lock should not attempt to re-acquire it. Doing so risks lockouts when there are also waiting writers.

    [ Introduction to this package. ]

    MicroStrategy Web 7.3.1 or earlier
    • Constructor Detail

      • WriterPreferenceReadWriteLock

        public WriterPreferenceReadWriteLock()
    • Method Detail

      • cancelledWaitingReader

        protected void cancelledWaitingReader()
      • cancelledWaitingWriter

        protected void cancelledWaitingWriter()
      • allowReader

        protected boolean allowReader()
        Override this method to change to reader preference *
      • startRead

        protected boolean startRead()
      • startWrite

        protected boolean startWrite()
      • startReadFromNewReader

        protected boolean startReadFromNewReader()
      • startWriteFromNewWriter

        protected boolean startWriteFromNewWriter()
      • startReadFromWaitingReader

        protected boolean startReadFromWaitingReader()
      • startWriteFromWaitingWriter

        protected boolean startWriteFromWaitingWriter()