de.sciss.collection.txn

HASkipList

object HASkipList extends AnyRef

A transactional version of the deterministic k-(2k+1) top-down operated skip list as described in T. Papadakis, Skip Lists and Probabilistic Analysis of Algorithms. Ch. 4 (Deterministic Skip Lists), pp. 55--78. Waterloo (CA) 1993

It uses the horizontal array technique with a parameter for k (minimum gap size). It uses a modified top-down removal algorithm that avoids the need for a second pass as in the original algorithm, and is careful about object creations, so that it will be able to persist the data structure without any unnecessary reads or writes to the store.

Three implementation notes: (1) We treat the nodes as immutable at the moment, storing them directly in the S#Val child pointers of their parents. While this currently seems to have a performance advantage (?), we could try to avoid this by using S#Refs for the child pointers, making the nodes becomes mutables. We could avoid copying the arrays for each insertion or deletion, at the cost of more space, but maybe better performance.

(2) The special treatment of isRight kind of sucks. Since now that information is also persisted, we might just have two types of branches and leaves, and avoid passing around this flag.

(3) Since there is a bug with the top-down one-pass removal, we might end up removing the creation of instances of virtual branches altogether again when replacing the current algorithm by a two-pass one.

TODO: nodes or at least leaves should be horizontally connected for a faster iterator and fast pair (interval) search

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. HASkipList
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Type Members

  1. final class Branch[S <: Sys[S], A] extends BranchLike[S, A] with HeadOrBranch[S, A] with Node[S, A]

  2. sealed trait BranchLike[S <: Sys[S], A] extends NodeLike[S, A]

  3. sealed trait HeadOrBranch[S <: Sys[S], A] extends AnyRef

  4. final class Leaf[S <: Sys[S], A] extends LeafLike[S, A] with Node[S, A]

  5. sealed trait LeafLike[S <: Sys[S], A] extends NodeLike[S, A]

  6. sealed trait Node[S <: Sys[S], A] extends NodeLike[S, A]

  7. sealed trait NodeLike[S <: Sys[S], A] extends AnyRef

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object Branch extends AnyRef

  7. object Leaf extends AnyRef

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. def empty[S <: Sys[S], A](minGap: Int, keyObserver: KeyObserver[Tx, A])(implicit tx: Tx, ord: Ordering[Tx, A], keySerializer: TxnSerializer[Tx, Acc, A]): HASkipList[S, A]

    Creates a new empty skip list.

    Creates a new empty skip list. Type parameter S specifies the STM system to use. Type parameter A specifies the type of the keys stored in the list.

    minGap

    the minimum gap-size used for the skip list. This value must be between 1 and 126 inclusive.

    keyObserver

    an object which observes key promotions and demotions. Use NoKeyObserver (default) if key motions do not need to be monitored. The monitoring allows the use of the skip list for synchronized decimations of related data structures, such as the deterministic skip quadtree.

    tx

    the transaction in which to initialize the structure

    ord

    the ordering of the keys. This is an instance of txn.Ordering to allow for specialized versions and transactional restrictions.

    keySerializer

    the serializer for the elements, in case a persistent STM is used.

  11. def empty[S <: Sys[S], A](implicit tx: Tx, ord: Ordering[Tx, A], keySerializer: TxnSerializer[Tx, Acc, A]): HASkipList[S, A]

    Creates a new empty skip list with default minimum gap parameter of 2 and no key observer.

    Creates a new empty skip list with default minimum gap parameter of 2 and no key observer. Type parameter S specifies the STM system to use. Type parameter A specifies the type of the keys stored in the list.

    tx

    the transaction in which to initialize the structure

    ord

    the ordering of the keys. This is an instance of txn.Ordering to allow for specialized versions and transactional restrictions.

    keySerializer

    the serializer for the elements, in case a persistent STM is used.

  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. def read[S <: Sys[S], A](in: DataInput, access: Acc, keyObserver: KeyObserver[Tx, A])(implicit tx: Tx, ordering: Ordering[Tx, A], keySerializer: TxnSerializer[Tx, Acc, A]): HASkipList[S, A]

  22. def serializer[S <: Sys[S], A](keyObserver: KeyObserver[Tx, A])(implicit ordering: Ordering[Tx, A], keySerializer: TxnSerializer[Tx, Acc, A]): TxnSerializer[Tx, Acc, HASkipList[S, A]]

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  24. def toString(): String

    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  26. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  27. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any