package
0.0.0-20231006063515-ce13bd10540d
Repository: https://github.com/shipengqi/example.v1.git
Documentation: pkg.go.dev

# Functions

for test.
No description provided by the author

# Constants

BUCKET_STATUS_NORMAL 代表散列桶正常.
BUCKET_STATUS_OVERWEIGHT 代表散列桶过重.
BUCKET_STATUS_UNDERWEIGHT 代表散列桶过轻.
DEFAULT_BUCKET_LOAD_FACTOR 默认的装载因子 当散列段中的某个散列桶的尺寸超过了 本因子与当散列段尺寸的乘积,就会触发 rehash.
DEFAULT_BUCKET_MAX_SIZE 单个 bucket 的默认最大尺寸.
DEFAULT_BUCKET_NUMBER 一个散列段包含 bucket 的默认数量.
No description provided by the author
No description provided by the author
No description provided by the author
MAX_CONCURRENCY 代表最大并发量.

# Structs

concurrency 并发量,也代表了 segments 的长度 散列段,每个散列段要提供对其包含的键值对的读写操作,通过锁来保证并发安全性。 多个散列段就由多个互斥锁保护。这样的加锁方式叫做 "分段锁"。分段锁可以降低互斥锁带来的开销,同时保护资源。 因为同一时刻同一个散列段中的键值对只能被一个 goroutine 进行读写。但是不同的散列段可以并发访问。 如果 concurrency 为 16,那么就可以有 16 个 goroutine 并发访问 ConcurrentMap。.
No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author
Pair 代表并发安全的键-元素对的接口.
PairRedistributor 代表针对键-元素对的再分布器 用于当散列段内的键-元素对分布不均时进行重新分布.
Segment 代表并发安全的散列段的接口.

# Type aliases

BucketStatus 代表散列桶状态的类型.