---
title: "atomic: type in the TypeShade language reference"
description: "atomic, a type in the TypeShade language reference. An atomic<u32> or atomic<i32>…"
url: https://typeshade.dev/reference/types/atomic/
language: en
---

# `atomic`

Type

An `atomic<u32>` or `atomic<i32>`: an integer location in a read-write storage binding that many invocations update at once through `atomicAdd`, `atomicLoad` and the other atomic builtins.

The signature, the sentence and any message are the compiler's own text at commit af54ddad5.

## Syntax

```ts
type atomic<T extends u32 | i32 = u32> = { readonly [atomicTag]: T }
```

## Parameters

- `T` optional `u32 | i32`

## Description

It is never read or assigned directly, and it is declared only inside a storage binding, as `declare const bins: storage<array<atomic<u32>>, "read_write">`.

## Examples

- [`path/histogram/histogram.shade.ts`](https://typeshade.dev/guide/examples/histogram/)
- [`gallery/atomic-histogram/atomic-histogram.shade.ts`](https://typeshade.dev/guide/examples/atomic-histogram/)
- [`gallery/compute-sync/compute-sync.shade.ts`](https://typeshade.dev/guide/examples/compute-sync/)
- [`gallery/subgroup-reduce/subgroup-reduce.shade.ts`](https://typeshade.dev/guide/examples/subgroup-reduce/)
- [`gallery/workgroup-scratch/workgroup-scratch.shade.ts`](https://typeshade.dev/guide/examples/workgroup-scratch/)

## See also

- [Types](https://typeshade.dev/reference/types/)
