import "github.com/byte-mug/golibs/concurrent/sortlist"
Yet another Concurrent Skiplist implementation. Changes are performed using atomic CAS operations. Inserts acquire a shared lock and Writes acquire an exclusive lock. All locking is done internally.
type Node struct { Key interface{} Value interface{} // contains filtered or unexported fields }
-
func (n *Node) Next() *Node
-
func (n *Node) String() string
-
type Sortlist struct { Cmp utils.Comparator // Required. Src rand.Source // Optional. // contains filtered or unexported fields }
-
func (s *Sortlist) Ceil(sk interface{}) *Node
-
func (s *Sortlist) Delete(k interface{}) *Node
-
func (s *Sortlist) Floor(sk interface{}) *Node
-
func (s *Sortlist) Insert(k, v interface{})
This function should really be called Put()!
func (s *Sortlist) Lookup(sk interface{}) *Node
-
func (s *Sortlist) Next(sk interface{}) *Node
-
func (s *Sortlist) Previous(sk interface{}) *Node
-
import "fmt"
import "github.com/emirpasic/gods/utils"
import "math/rand"
import "sync"
import "sync/atomic"
import "unsafe"