https://github.com/shgopher/cmap
go实现一个分片的哈希表
https://github.com/shgopher/cmap
fasthashmap fastmap hash hashtable map
Last synced: 10 months ago
JSON representation
go实现一个分片的哈希表
- Host: GitHub
- URL: https://github.com/shgopher/cmap
- Owner: shgopher
- License: apache-2.0
- Created: 2021-01-13T16:10:02.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-14T17:03:26.000Z (almost 5 years ago)
- Last Synced: 2023-03-05T23:31:27.976Z (almost 3 years ago)
- Topics: fasthashmap, fastmap, hash, hashtable, map
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go实现一个分片的哈希表
使用方法:
````go
// 线程安全
cs := NewCamp()
cs.Set("shgopher",shgopher)
cs.Get("shgopher")
````
本方法就是一种使用了,一致性哈希,然后将问题分布式的一种算法。通过哈希函数,将这些写入和读取的过程分为不同的组去处理,然后锁的颗粒度自然就降低了