Introduction

An atomic class that guarantees atomic updates to its contained value.

You can report bugs and discuss features on the issues page.

Table Of Contents

Installation

  1. Either check out Atomic from GitHub or to pull a release off PyPI

    pip install atomic
    

Usage

class atomic.AtomicLong(value=None)

An atomic class that guarantees atomic updates to its contained integer value.

compare_and_set(expect_value, new_value)

Atomically sets the value to the given value if the current value is equal to the expected value.

Parameters:
  • expect_value – the expected value
  • new_value – the new value
get_and_set(new_value)

Atomically sets to the given value and returns the old value

Parameters:new_value – the new value
class atomic.AtomicLongArray(array=[])

An atomic class that guarantees atomic updates to its contained integer values.

Indices and tables