sync

package
v0.29.8-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 4 Imported by: 7 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RingMutex

type RingMutex struct {
	// contains filtered or unexported fields
}

func NewRingMutex

func NewRingMutex(mutexCount int, hashMaker func() hash.Hash64) *RingMutex

Create a RW mutex that provides a pseudo-independent set of mutexes for addresses where the address space is mapped into possibly much smaller set of backing mutexes using the xxhash (non-cryptographic) hash function // modulo size. If some addresses collide modulo size they will be unnecessary contention between those addresses, but you can trade space against contention as desired.

func NewRingMutexNoHash

func NewRingMutexNoHash(mutexCount int) *RingMutex

func NewRingMutexXXHash

func NewRingMutexXXHash(mutexCount int) *RingMutex

func (*RingMutex) Lock

func (mtx *RingMutex) Lock(address []byte) (value *Value)

func (*RingMutex) Mutex

func (mtx *RingMutex) Mutex(address []byte) *sync.RWMutex

func (*RingMutex) MutexCount

func (mtx *RingMutex) MutexCount() uint64

Return the size of the underlying array of mutexes

func (*RingMutex) RLock

func (mtx *RingMutex) RLock(address []byte)

func (*RingMutex) RUnlock

func (mtx *RingMutex) RUnlock(address []byte)

func (*RingMutex) Unlock

func (mtx *RingMutex) Unlock(address []byte)

type Value added in v0.20.1

type Value struct {
	// contains filtered or unexported fields
}

func (*Value) Get added in v0.20.1

func (v *Value) Get() interface{}

func (*Value) IsSet added in v0.20.1

func (v *Value) IsSet() bool

func (*Value) Set added in v0.20.1

func (v *Value) Set(value interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL