{"id":13629190,"url":"https://github.com/concurrencykit/ck","last_synced_at":"2025-05-14T13:09:17.342Z","repository":{"id":16141690,"uuid":"18887187","full_name":"concurrencykit/ck","owner":"concurrencykit","description":"Concurrency primitives, safe memory reclamation mechanisms and non-blocking (including lock-free) data structures designed to aid in the research, design and implementation of high performance concurrent systems developed in C99+.","archived":false,"fork":false,"pushed_at":"2025-03-07T15:05:13.000Z","size":2091,"stargazers_count":2474,"open_issues_count":12,"forks_count":323,"subscribers_count":114,"default_branch":"master","last_synced_at":"2025-04-11T05:10:03.376Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://concurrencykit.org/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/concurrencykit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-04-17T17:29:39.000Z","updated_at":"2025-04-05T15:55:44.000Z","dependencies_parsed_at":"2023-12-03T02:25:42.249Z","dependency_job_id":"f0f7cf28-09e5-4b44-b141-27e98259bc0a","html_url":"https://github.com/concurrencykit/ck","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concurrencykit%2Fck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concurrencykit%2Fck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concurrencykit%2Fck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concurrencykit%2Fck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/concurrencykit","download_url":"https://codeload.github.com/concurrencykit/ck/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345266,"owners_count":21088244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T22:01:04.172Z","updated_at":"2025-04-11T05:10:08.103Z","avatar_url":"https://github.com/concurrencykit.png","language":"C","readme":"# Concurrency Kit\n\nModern concurrency primitives and building blocks for high performance applications.\n\n### Continuous Integration\n\n| GitHub Actions | Cirrus |\n| -------- | ------- |\n| [![Build Status](https://github.com/concurrencykit/ck/workflows/CI/badge.svg)](https://github.com/concurrencykit/ck/actions?query=workflow%3ACI+branch%3Amaster) | [![Build Status](https://api.cirrus-ci.com/github/concurrencykit/ck.svg?branch=master)](https://cirrus-ci.com/github/concurrencykit/ck) |\n\nCompilers tested in the past include gcc, clang, cygwin, icc, mingw32, mingw64\nand suncc across all supported architectures. All new architectures are\nrequired to pass the integration test and under-go extensive code review.\n\nContinuous integration is currently enabled for the following targets:\n * `darwin/clang/arm64`\n * `freebsd/clang/x86-64`\n * `linux/gcc/arm64`\n * `linux/gcc/x86-64`\n * `linux/clang/x86-64`\n\n### Compile and Build\n\n* Step 1.\n   `./configure`\n   For additional options try `./configure --help`\n\n* Step 2.\n   In order to compile regressions (requires POSIX threads) use\n   `make regressions`. In order to compile libck use `make all` or `make`.\n\n* Step 3.\n\tIn order to install use `make install`\n\tTo uninstall use `make uninstall`.\n\nSee http://concurrencykit.org/ for more information.\n\n### Supported Architectures\n\nConcurrency Kit supports any architecture using compiler built-ins as a\nfallback. There is usually a performance degradation associated with this.\n\nConcurrency Kit has specialized assembly for the following architectures:\n * `aarch64`\n * `arm`\n * `ppc`\n * `ppc64`\n * `riscv64`\n * `s390x`\n * `sparcv9+`\n * `x86`\n * `x86_64`\n \n### Features\n\n#### Concurrency Primitives\n\n##### ck_pr\n\nConcurrency primitives including architecture-specific ones. Provides wrappers\naround CAS in case of missing native support. This also provides support for\nRTM (transactional memory), pipeline control, read-for-ownership and more.\n\n##### ck_backoff\n\nA simple and efficient (minimal noise) backoff function.\n\n##### ck_cc\n\nAbstracted compiler builtins when writing efficient concurrent data structures.\n\n#### Safe Memory Reclamation\n\n##### ck_epoch\n\nA scalable safe memory reclamation mechanism with support for idle threads and\nvarious optimizations that make it better than or competitive with many\nstate-of-the-art solutions.\n\n##### ck_hp\n\nImplements support for hazard pointers, a simple and efficient lock-free safe\nmemory reclamation mechanism.\n\n#### Data Structures\n\n##### ck_array\n\nA simple concurrently-readable pointer array structure.\n\n##### ck_bitmap\n\nAn efficient multi-reader and multi-writer concurrent bitmap structure.\n\n##### ck_ring\n\nEfficient concurrent bounded FIFO data structures with various performance\ntrade-off. This includes specialization for single-reader, many-reader,\nsingle-writer and many-writer.\n\n##### ck_fifo\n\nA reference implementation of the first published lock-free FIFO algorithm,\nwith specialization for single-enqueuer-single-dequeuer and\nmany-enqueuer-single-dequeuer and extensions to allow for node re-use.\n\n##### ck_hp_fifo\n\nA reference implementation of the above algorithm, implemented with safe memory\nreclamation using hazard pointers.\n\n##### ck_hp_stack\n\nA reference implementation of a Treiber stack with support for hazard pointers.\n\n##### ck_stack\n\nA reference implementation of an efficient lock-free stack, with specialized\nvariants for a variety of memory management strategies and bounded concurrency.\n\n##### ck_queue\n\nA concurrently readable friendly derivative of the BSD-queue interface. Coupled\nwith a safe memory reclamation mechanism, implement scalable read-side queues\nwith a simple search and replace.\n\n##### ck_hs\n\nAn extremely efficient single-writer-many-reader hash set, that satisfies\nlock-freedom with bounded concurrency without any usage of atomic operations\nand allows for recycling of unused or deleted slots. This data structure is\nrecommended for use as a general hash-set if it is possible to compute values\nfrom keys.\n\n##### ck_ht\n\nA specialization of the `ck_hs` algorithm allowing for disjunct key-value pairs.\n\n##### ck_rhs\n\nA variant of `ck_hs` that utilizes robin-hood hashing to allow for improved\nperformance with higher load factors and high deletion rates.\n\n#### Synchronization Primitives\n\n##### ck_ec\n\nAn extremely efficient event counter implementation, a better alternative to\ncondition variables with specialization for fixed concurrency use-cases.\n\n##### ck_barrier\n\nA plethora of execution barriers including: centralized barriers, combining\nbarriers, dissemination barriers, MCS barriers, tournament barriers.\n\n##### ck_brlock\n\nA simple big-reader lock implementation, write-biased reader-writer lock with\nscalable read-side locking.\n\n##### ck_bytelock\n\nAn implementation of bytelocks, for research purposes, allowing for (in\ntheory), fast read-side acquisition without the use of atomic operations. In\nreality, memory barriers are required on the fast path.\n\n##### ck_cohort\n\nA generic lock cohorting interface, allows you to turn any lock into a\nNUMA-friendly scalable NUMA lock. There is a significant trade-off in fast path\nacquisition cost. Specialization is included for all relevant lock\nimplementations in Concurrency Kit. Learn more by reading \"Lock Cohorting: A\nGeneral Technique for Designing NUMA Locks\".\n\n##### ck_elide\n\nA generic lock elision framework, allows you to turn any lock implementation\ninto an elision-aware implementation. This requires support for restricted\ntransactional memory by the underlying hardware.\n\n##### ck_pflock\n\nPhase-fair reader-writer mutex that provides strong fairness guarantees between\nreaders and writers. Learn more by reading \"Spin-Based Reader-Writer\nSynchronization for Multiprocessor Real-Time Systems\".\n\n##### ck_rwcohort\n\nA generic read-write lock cohorting interface, allows you to turn any\nread-write lock into a NUMA-friendly scalable NUMA lock. There is a significant\ntrade-off in fast path acquisition cost. Specialization is included for all\nrelevant lock implementations in Concurrency Kit. Learn more by reading \"Lock\nCohorting: A General Technique for Designing NUMA Locks\".\n\n##### ck_rwlock\n\nA simple centralized write-biased read-write lock.\n\n##### ck_sequence\n\nA sequence counter lock, popularized by the Linux kernel, allows for very fast\nread and write synchronization for simple data structures where deep copy is\npermitted.\n\n##### ck_swlock\n\nA single-writer specialized read-lock that is copy-safe, useful for data\nstructures that must remain small, be copied and contain in-band mutexes.\n\n##### ck_tflock\n\nTask-fair locks are fair read-write locks, derived from \"Scalable reader-writer\nsynchronization for shared-memory multiprocessors\".\n\n##### ck_spinlock\n\nA basic but very fast spinlock implementation.\n\n##### ck_spinlock_anderson\n\nScalable and fast anderson spinlocks. This is here for reference, one of the\nearliest scalable and fair lock implementations.\n\n##### ck_spinlock_cas\n\nA basic spinlock utilizing compare_and_swap.\n\n##### ck_spinlock_dec\n\nA basic spinlock, a C adaption of the older optimized Linux kernel spinlock for\nx86. Primarily here for reference.\n\n##### ck_spinlock_fas\n\nA basic spinlock utilizing atomic exchange.\n\n##### ck_spinlock_clh\n\nAn efficient implementation of the scalable CLH lock, providing many of the\nsame performance properties of MCS with a better fast-path.\n\n##### ck_spinlock_hclh\n\nA NUMA-friendly CLH lock.\n\n##### ck_spinlock_mcs\n\nAn implementation of the seminal scalable and fair MCS lock.\n\n##### ck_spinlock_ticket\n\nAn implementation of fair centralized locks.\n\n","funding_links":[],"categories":["Concurrency","C","Libraries","C++","Multithreading \u0026 Concurrency"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcurrencykit%2Fck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconcurrencykit%2Fck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcurrencykit%2Fck/lists"}