Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Concurrentqueue | 7,886 | 3 months ago | 31 | other | C++ | |||||
A fast multi-producer, multi-consumer lock-free concurrent queue for C++11 | ||||||||||
Crossbeam | 6,331 | 1,476 | 1,148 | 10 days ago | 35 | April 09, 2023 | 123 | apache-2.0 | Rust | |
Tools for concurrent programming in Rust | ||||||||||
Concurrent Ruby | 5,528 | 111 | 25 days ago | 69 | February 24, 2023 | 50 | other | Ruby | ||
Modern concurrency tools including agents, futures, promises, thread pools, supervisors, and more. Inspired by Erlang, Clojure, Scala, Go, Java, JavaScript, and classic concurrency patterns. | ||||||||||
Concurrent Map | 3,863 | 83 | 319 | a month ago | 4 | November 08, 2022 | 30 | mit | Go | |
a thread-safe concurrent map for go | ||||||||||
Golang Set | 3,483 | 503 | 2,311 | 5 days ago | 9 | August 02, 2023 | 6 | other | Go | |
A simple, battle-tested and generic set type for the Go language. Trusted by Docker, 1Password, Ethereum and Hashicorp. | ||||||||||
Concurrencpp | 1,692 | 5 days ago | 7 | mit | C++ | |||||
Modern concurrency for C++. Tasks, executors, timers and C++20 coroutines to rule them all | ||||||||||
Greenlet | 1,513 | 9,890 | 504 | 10 days ago | 45 | September 01, 2023 | 17 | other | C++ | |
Lightweight in-process concurrent programming | ||||||||||
Pypeln | 1,412 | 5 | 6 | 4 months ago | 36 | January 06, 2022 | 22 | mit | Python | |
Concurrent data pipelines in Python >>> | ||||||||||
Java Study | 1,119 | 3 months ago | 12 | apache-2.0 | Java | |||||
java-study 是本人学习Java过程中记录的一些代码!从Java基础的数据类型、jdk1.8的Lambda、Stream和日期的使用、 IO流、数据集合、多线程使用、并发编程、23种设计模式示例代码、常用的工具类, 以及一些常用框架,netty、mina、springboot、kafka、storm、zookeeper、redis、elasticsearch、hbase、hive等等。 | ||||||||||
Java Concurrency | 748 | 3 years ago | 10 | |||||||
Checklist for code reviews |
As explained here and here, the map
type in Go doesn't support concurrent reads and writes. concurrent-map
provides a high-performance solution to this by sharding the map with minimal time spent waiting for locks.
Prior to Go 1.9, there was no concurrent map implementation in the stdlib. In Go 1.9, sync.Map
was introduced. The new sync.Map
has a few key differences from this map. The stdlib sync.Map
is designed for append-only scenarios. So if you want to use the map for something more like in-memory db, you might benefit from using our version. You can read more about it in the golang repo, for example here and here
Import the package:
import (
"github.com/orcaman/concurrent-map/v2"
)
go get "github.com/orcaman/concurrent-map/v2"
The package is now imported under the "cmap" namespace.
// Create a new map.
m := cmap.New[string]()
// Sets item within map, sets "bar" under key "foo"
m.Set("foo", "bar")
// Retrieve item from map.
bar, ok := m.Get("foo")
// Removes item under key "foo"
m.Remove("foo")
For more examples have a look at concurrent_map_test.go.
Running tests:
go test "github.com/orcaman/concurrent-map/v2"
Contributions are highly welcome. In order for a contribution to be merged, please follow these guidelines:
concurrent-map
as simple as possible and as similar to the native map
. Please keep this in mind when opening issues.MIT (see LICENSE file)