All Projects → orcaman → Concurrent Map

orcaman / Concurrent Map

Licence: mit
a thread-safe concurrent map for go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Concurrent Map

traffic
Massively real-time traffic streaming application
Stars: ✭ 25 (-99.05%)
Mutual labels:  map, concurrency, concurrent-programming
transit
Massively real-time city transit streaming application
Stars: ✭ 20 (-99.24%)
Mutual labels:  map, concurrency, concurrent-programming
Zio
ZIO — A type-safe, composable library for async and concurrent programming in Scala
Stars: ✭ 3,167 (+20.56%)
Mutual labels:  concurrency, concurrent-programming
Promise Pool
Map-like, concurrent promise processing
Stars: ✭ 258 (-90.18%)
Mutual labels:  concurrency, map
Concurrencpp
Modern concurrency for C++. Tasks, executors, timers and C++20 coroutines to rule them all
Stars: ✭ 340 (-87.06%)
Mutual labels:  concurrency, concurrent-programming
mux-stream
(De)multiplex asynchronous streams
Stars: ✭ 34 (-98.71%)
Mutual labels:  concurrency, concurrent-programming
geeteventbus
An inprocess eventbus for highly concurrent Python applications
Stars: ✭ 17 (-99.35%)
Mutual labels:  concurrency, concurrent-programming
Golang Tutorials
Go Tutorials - Let's get our hands really dirty by writing a lot of Golang code
Stars: ✭ 277 (-89.46%)
Mutual labels:  concurrency, concurrent-programming
concurrent-resource
A header-only C++ library that allows easily creating thread-safe, concurrency friendly resources.
Stars: ✭ 17 (-99.35%)
Mutual labels:  concurrency, thread-safety
Mt
tlock, RWMUTEX, Collab, USM, RSem and other C++ templates for Windows to provide read/write mutex locks, various multithreading tools, collaboration, differential updates and more
Stars: ✭ 18 (-99.31%)
Mutual labels:  concurrency, concurrent-programming
Fucking Java Concurrency
🎏 Simple show cases of java concurrency problems, seeing 🙈 is believing 🐵
Stars: ✭ 779 (-70.35%)
Mutual labels:  concurrency, concurrent-programming
Sobjectizer
An implementation of Actor, Publish-Subscribe, and CSP models in one rather small C++ framework. With performance, quality, and stability proved by years in the production.
Stars: ✭ 172 (-93.45%)
Mutual labels:  concurrency, concurrent-programming
Chymyst Core
Declarative concurrency in Scala - The implementation of the chemical machine
Stars: ✭ 142 (-94.59%)
Mutual labels:  concurrency, concurrent-programming
AtomicKit
Concurrency made simple in Swift.
Stars: ✭ 88 (-96.65%)
Mutual labels:  concurrency, thread-safety
TAOMP
《多处理器编程的艺术》一书中的示例代码实现,带有注释与单元测试
Stars: ✭ 39 (-98.52%)
Mutual labels:  concurrency, concurrent-programming
Java Concurrency
Java并发知识点总结
Stars: ✭ 3,457 (+31.59%)
Mutual labels:  concurrency, concurrent-programming
java-multithread
Códigos feitos para o curso de Multithreading com Java, no canal RinaldoDev do YouTube.
Stars: ✭ 24 (-99.09%)
Mutual labels:  concurrency, concurrent-programming
scalable-concurrent-containers
High performance containers and utilities for concurrent and asynchronous programming
Stars: ✭ 101 (-96.16%)
Mutual labels:  concurrency, concurrent-programming
Java Concurrency Progamming Tutorial
BAT华为大厂一线工程师四年磨一剑精心编排 Java 高并发编程案例代码 & 教程 & 面试题集锦。详细文档讲解请阅读本人的知识库仓:https://github.com/Wasabi1234/Java-Interview-Tutorial
Stars: ✭ 606 (-76.93%)
Mutual labels:  concurrency, concurrent-programming
Awesome Lockfree
A collection of resources on wait-free and lock-free programming
Stars: ✭ 1,046 (-60.18%)
Mutual labels:  concurrency, concurrent-programming

concurrent map Build Status

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

usage

Import the package:

import (
	"github.com/orcaman/concurrent-map"
)
go get "github.com/orcaman/concurrent-map"

The package is now imported under the "cmap" namespace.

example

	// Create a new map.
	m := cmap.New()

	// Sets item within map, sets "bar" under key "foo"
	m.Set("foo", "bar")

	// Retrieve item from map.
	if tmp, ok := m.Get("foo"); ok {
		bar := tmp.(string)
	}

	// 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"

guidelines for contributing

Contributions are highly welcome. In order for a contribution to be merged, please follow these guidelines:

  • Open an issue and describe what you are after (fixing a bug, adding an enhancement, etc.).
  • According to the core team's feedback on the above mentioned issue, submit a pull request, describing the changes and linking to the issue.
  • New code must have test coverage.
  • If the code is about performance issues, you must include benchmarks in the process (either in the issue or in the PR).
  • In general, we would like to keep concurrent-map as simple as possible and as similar to the native map. Please keep this in mind when opening issues.

language

license

MIT (see LICENSE file)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].