sync

package
v6.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressRWMutex

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

func NewAddressRWMutex

func NewAddressRWMutex(mutexCount int) *AddressRWMutex

Create a 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 (*AddressRWMutex) Lock

func (mtx *AddressRWMutex) Lock(address []byte)

func (*AddressRWMutex) RLock

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

func (*AddressRWMutex) RUnlock

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

func (*AddressRWMutex) Size

func (mtx *AddressRWMutex) Size() uint64

Return the size of the underlying array of mutexes

func (*AddressRWMutex) Unlock

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

Jump to

Keyboard shortcuts

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