All Projects → jserv → concurrent-ll

jserv / concurrent-ll

Licence: other
concurrent linked list implementation

Programming Languages

c
50402 projects - #5 most used programming language
shell
77523 projects
Makefile
30231 projects
Gnuplot
187 projects

Projects that are alternatives of or similar to concurrent-ll

Crossbeam
Tools for concurrent programming in Rust
Stars: ✭ 4,180 (+6233.33%)
Mutual labels:  concurrency, lock-free
Xenium
A C++ library providing various concurrent data structures and reclamation schemes.
Stars: ✭ 225 (+240.91%)
Mutual labels:  concurrency, lock-free
Awesome Lockfree
A collection of resources on wait-free and lock-free programming
Stars: ✭ 1,046 (+1484.85%)
Mutual labels:  concurrency, lock-free
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 (+324.24%)
Mutual labels:  concurrency, lock-free
Cloudi
A Cloud at the lowest level!
Stars: ✭ 352 (+433.33%)
Mutual labels:  scalability, concurrency
Concurrencyfreaks
Stars: ✭ 299 (+353.03%)
Mutual labels:  concurrency, lock-free
Left Right
A lock-free, read-optimized, concurrency primitive.
Stars: ✭ 1,245 (+1786.36%)
Mutual labels:  concurrency, lock-free
Thmap
Concurrent trie-hash map library
Stars: ✭ 51 (-22.73%)
Mutual labels:  concurrency, lock-free
ring-election
A node js library with a distributed leader/follower algorithm ready to be used
Stars: ✭ 92 (+39.39%)
Mutual labels:  scalability, concurrency
beems
a bee-queue based minimalist toolkit for building fast, decentralized, scalable and fault tolerant microservices
Stars: ✭ 33 (-50%)
Mutual labels:  scalability, concurrency
concurrency-kit
🚄 Concurrency abstractions framework for Apple Platforms [Task, Atomic, Lock, Operation, etc.].
Stars: ✭ 17 (-74.24%)
Mutual labels:  concurrency, atomics
Orleans
Orleans is a cross-platform framework for building distributed applications with .NET
Stars: ✭ 8,131 (+12219.7%)
Mutual labels:  scalability, concurrency
optimistic lock coupling rs
🍋: A General Lock following paper "Optimistic Lock Coupling: A Scalable and Efficient General-Purpose Synchronization Method"
Stars: ✭ 21 (-68.18%)
Mutual labels:  concurrency, lock-free
Spscqueue
A bounded single-producer single-consumer wait-free and lock-free queue written in C++11
Stars: ✭ 307 (+365.15%)
Mutual labels:  concurrency, lock-free
Jctools
jctools.github.io/jctools
Stars: ✭ 2,833 (+4192.42%)
Mutual labels:  concurrency, lock-free
System design
Preparation links and resources for system design questions
Stars: ✭ 7,170 (+10763.64%)
Mutual labels:  scalability, concurrency
Thespian
Python Actor concurrency library
Stars: ✭ 220 (+233.33%)
Mutual labels:  scalability, concurrency
InterviewPrep
A repository containing link of good interview questions
Stars: ✭ 54 (-18.18%)
Mutual labels:  linked-list
go-left-right
A faster RWLock primitive in Go, 2-3 times faster than RWMutex. A Go implementation of concurrency control algorithm in paper <Left-Right - A Concurrency Control Technique with Wait-Free Population Oblivious Reads>
Stars: ✭ 42 (-36.36%)
Mutual labels:  concurrency
event pool
a header-only event-driven library based on c++11.
Stars: ✭ 27 (-59.09%)
Mutual labels:  concurrency

concurrent-ll

The concurrent-ll package contains the skeleton code for implementing and evaluating two concurrent linked lists: a lock-free and a lock-based. The implementations should work on any Linux-based x86/x86_64/Arm64 environments.

Both lists are sorted and provide three main operations:

  • adding an element to the list (if not already in the list)
  • removing an element from the list (if already in the list)
  • looking for an element in the list

In our case, a node of the list contains at least an integer key.

The lock-based implementation will use a technique called "hand-over-hand locking", while the lock-free will be based on Harris' algorithm (reference below).

Reference

Lock-free linkedlist implementation of Harris' algorithm

"A Pragmatic Implementation of Non-Blocking Linked Lists" T. Harris, p. 300-314, DISC 2001.

Build

You can compile the code (in Linux) by calling:

$ make

in the base directory.

If the number of cores on your processor is not recognized properly, fix it in include/utils.h.

You can verify by calling:

$ make check

Benchmarking

You can invoke the benchmarking scripts by calling:

$ make bench

Tools

You can find several useful scripts that will help you test and evaluate your implementations.

In details:

  • scripts/test_correctness.sh: test the correctness of an implementation, by stressing it
  • scripts/scalability1.sh: benchmark 1 application and get its throughput and scalability E.g., scripts/scalability1.sh all out/test-lock -i128
  • scripts/scalability2.sh: benchmark 2 applications and get their throughput and scalability E.g., scripts/scalability2.sh all out/test-lock out/test-lockfree -i100
  • scripts/run_ll.sh: execute the workloads that will be part of the deliverable
  • scripts/create_plots_ll.sh: generate the plots (int plots folder) of the data generated with scripts/run_ll.sh Note: You need gnuplot installed

Implementation

You can find an easy-to-use interface for atomic operations in include/atomics.h.

  • list.h: contains the interface and the structures of the list.

  • list.c: contains the implementations of the operations of the list, i.e., creating a new list and a new bucket, freeing the list, and, of course, adding, removing, and looking for an element in the list.

You might change the list and node structures to reflect the list and a node of a list of your implementations respectively.

Additionally, for the lock-based version, you need to implement and use some locks. You can find the skeletons for initializing, freeing, locking, and unlocking a lock in include/lock.h.

Memory management is one of most cumbersome problems on lock-free data structures. In other words, when a thread removes an element (a node) from the structure, it cannot always free the memory for that node, because other threads might be holding a reference to this memory.

When using locks, memory management is rather straightforward, because of the mutual exclusion property of locks. You can optionally implement memory management on the lock-based version.

License

concurrent-ll is released under the BSD 2 clause license. Use of this source code is governed by a BSD-style license that can be found in the 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].