# google/nsync

nsync is a C library that exports various synchronization primitives, such as mutexes

Repository: https://github.com/google/nsync
Canonical: https://ross.abutalabs.com/products/nsync
Language: C
License: Apache-2.0
License Family: permissive
Last push: 2025-10-29T22:48:20+00:00

## Health v2 (maintenance only)
Score: 54/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 49, release rhythm 35, longevity 100
- inputs: {"age_days": 3462, "days_push": 308, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1280, forks 90 (observed 2026-08-28T04:04:13.554555+00:00)

## What it is
nsync is a portable C library exporting synchronization primitives such as mutexes, reader-writer locks, condition variables, run-once initialization, waitable counters, and waitable bits. It offers conditional critical sections and cancellable waits as alternatives to pthread primitives, with small memory footprints and broad platform support.

## Use cases
- replace pthread mutexes with more efficient reader-writer locks
- implement cancellable waits in multithreaded C code
- use conditional critical sections instead of condition variable while-loops
- synchronize threads in a portable C library across Unix and Windows
- implement barriers with waitable counters
- run-once lazy initialization in C

## When to choose
- you need lightweight, portable synchronization primitives in C or C++
- you want cancellable waits without cancelling whole threads
- you need reader-writer locks as fast as mutexes
- you must compile with only a C90 compiler

## When to avoid
- your project already works fine with pthreads or C++ standard library primitives
- you need a class-based C++ synchronization API
- you want a widely familiar API for team onboarding

## Facets
- artifact type: library
- maturity: active
- function: concurrency
- domain: developer-tools, performance
- platform: windows, cpp, c, cross-platform
- tags: synchronization-primitives, mutexes, condition-variables, reader-writer-locks, c90-portable, cancellation, algorithms, linux, macos

## Member repositories
- google/nsync (main) score 54

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:13.554555+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T05:02:37.321323+00:00, confidence not recorded.
  - readme: https://github.com/google/nsync (fetched 2026-08-28T04:04:13.554555+00:00, sha 7fa00bbe97b8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
