# uber-go/atomic

Wrapper types for sync/atomic which enforce atomic access

Repository: https://github.com/uber-go/atomic
Canonical: https://ross.abutalabs.com/products/uber-go-atomic
Homepage: https://go.uber.org/atomic
Language: Go
License: MIT
License Family: permissive
Last push: 2025-04-14T21:33:18+00:00

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

## Adoption (not part of the score)
Stars 1452, forks 116 (observed 2026-08-28T04:04:46.449560+00:00)

## What it is
A Go library providing wrapper types for primitive types that enforce atomic access, offering a safer and more convenient API than the standard library's sync/atomic package. It preserves all sync/atomic functionality while making it harder to accidentally access variables non-atomically.

## Use cases
- safely share counters across goroutines
- enforce atomic access to primitive variables in Go
- replace error-prone sync/atomic usage with type-safe wrappers
- implement lock-free counters and flags
- avoid data races on shared numeric state

## When to choose
- you need atomic operations on primitives in Go and want compile-time safety
- your team struggles with remembering which variables require atomic access
- you want convenient methods like Store, Add, and CompareAndSwap on typed values

## When to avoid
- you only need simple mutex-protected state and prefer standard library only
- you need atomic operations on complex structs rather than primitives
- you are not writing Go

## Facets
- artifact type: library
- maturity: stable
- function: concurrency, developer-tools
- domain: developer-tools
- platform: go, cross-platform
- tags: atomic-operations, sync, type-safety, go-library, algorithms

## Member repositories
- uber-go/atomic (main) score 30

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:46.449560+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-30T04:35:49.690937+00:00, confidence not recorded.
  - readme: https://github.com/uber-go/atomic (fetched 2026-08-28T04:04:46.449560+00:00, sha 5f725381247b)
  - homepage: https://go.uber.org/atomic (fetched 2026-08-29T11:45:07.449283+00:00, sha 4aad7164c395)
- Data as of 2026-08-30T08:39:29.467469+00:00.
