All Projects → VSadov → Nonblocking

VSadov / Nonblocking

Licence: mit
Implementation of a lock-free dictionary on .Net.

Projects that are alternatives of or similar to Nonblocking

Corium
Corium is a modern scripting language which combines simple, safe and efficient programming.
Stars: ✭ 18 (-92.41%)
Mutual labels:  fast, high-performance
Gramework
Fast and Reliable Golang Web Framework
Stars: ✭ 354 (+49.37%)
Mutual labels:  high-performance, fast
gumble
Collection of high-performance, thread-safe, lock-free data structures for go
Stars: ✭ 12 (-94.94%)
Mutual labels:  high-performance, lock-free
BeLibnids
It is a platform to use multiprocess to combine dpdk and libnids together to support analyse packets in 10G port.
Stars: ✭ 36 (-84.81%)
Mutual labels:  fast, high-performance
Sled
the champagne of beta embedded databases
Stars: ✭ 5,423 (+2188.19%)
Mutual labels:  lock-free, high-performance
hatrack
Fast, multi-reader, multi-writer, lockless data structures for parallel programming
Stars: ✭ 55 (-76.79%)
Mutual labels:  high-performance, lock-free
Mlib
Library of generic and type safe containers in pure C language (C99 or C11) for a wide collection of container (comparable to the C++ STL).
Stars: ✭ 321 (+35.44%)
Mutual labels:  dictionary, lock-free
Clevergo
👅 CleverGo is a lightweight, feature rich and high performance HTTP router for Go.
Stars: ✭ 246 (+3.8%)
Mutual labels:  high-performance, fast
Libcopp
cross-platform coroutine library in c++
Stars: ✭ 398 (+67.93%)
Mutual labels:  lock-free, high-performance
Atomic queue
C++ lockless queue.
Stars: ✭ 373 (+57.38%)
Mutual labels:  lock-free, high-performance
LruClockCache
A low-latency LRU approximation cache in C++ using CLOCK second-chance algorithm. Multi level cache too. Up to 2.5 billion lookups per second.
Stars: ✭ 35 (-85.23%)
Mutual labels:  fast, high-performance
Hugo Papermod
A fast, clean, responsive Hugo theme
Stars: ✭ 1,202 (+407.17%)
Mutual labels:  high-performance, fast
websocket
WebSocket for fasthttp
Stars: ✭ 51 (-78.48%)
Mutual labels:  fast, high-performance
Maat
Validation and transformation library powered by deductive ascending parser. Made to be extended for any kind of project.
Stars: ✭ 27 (-88.61%)
Mutual labels:  fast, dictionary
PyGLM
Fast OpenGL Mathematics (GLM) for Python
Stars: ✭ 167 (-29.54%)
Mutual labels:  fast, high-performance
Object threadsafe
We make any object thread-safe and std::shared_mutex 10 times faster to achieve the speed of lock-free algorithms on >85% reads
Stars: ✭ 280 (+18.14%)
Mutual labels:  lock-free, high-performance
Numpy Stl
Simple library to make working with STL files (and 3D objects in general) fast and easy.
Stars: ✭ 356 (+50.21%)
Mutual labels:  high-performance, fast
Shineout
高性能React组件库
Stars: ✭ 577 (+143.46%)
Mutual labels:  high-performance, fast
Imtools
Fast and memory-efficient immutable collections and helper data structures
Stars: ✭ 85 (-64.14%)
Mutual labels:  dictionary, lock-free
Tensorflow Fast Style Transfer
A simple, concise tensorflow implementation of fast style transfer
Stars: ✭ 224 (-5.49%)
Mutual labels:  fast

NonBlocking

Implementation of a non-blocking dictionary.
https://www.nuget.org/packages/NonBlocking

Overview

NonBlocking dictionary:

  • NonBlocking dictionary has the same API as ConcurrentDictionary.
  • No locks are taken during any operation including Get, Add, Remove, internal resizes etc...
  • While multiple threads accessing NonBlocking dictionary will help each other in operations such as table resizing, there is no dependency on such behavior. If any thread get unscheduled or delayed for whatever reason, other threads will be able to make progress independently.

Implementation notes

Core algorithms are based on NonBlockingHashMap, written and released to the public domain by Dr. Cliff Click. A good overview is here https://www.youtube.com/watch?v=HJ-719EGIts

Most differences of this implementation are motivated by the differences in public APIs on .Net platform:

  • .Net has structs and reified generics.
  • platform APIs such as Interlocked.CompareExchange have differences.
  • ConcurrentDictionary API differs from a typical java dictionary.

Tested on platforms:

  • x86
  • x64
  • arm
  • arm64

Performance

On most operations NonBlocking dictionary is faster than ConcurrentDictionary. It is particularly faster in write-heavy scenarios.
Read/Write oprations scale linearly with the number of active threads if hardware/OS permits.

Benchmarks

The test machine is
AMD EPYC 64-Core Processor

Base speed:	2.44 GHz
Sockets:	4
Cores:	128
Logical processors:	256

Configured as: 4 NUMA nodes  

The following sample benchmarks perform various operations on {int --> string} dictionaries and run as 64bit process.

Get The machine is configured as 4-node NUMA and Windows scheduler would use cores from one node, then their HT siblings, and only then use another node. Thus we see "steps".

Write Not taking locks makes writes cheaper.

Add When a table grows to 1000000 element we start over with a new table.
Add/Resize scale well when no locks need to be taken, as long as the rest of the system (like GC) can keep up.

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].