Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Atomics

Index

Properties

__@toStringTag

__@toStringTag: "Atomics"

Methods

add

  • add(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number
  • Adds a value to the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

    Parameters

    • typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
    • index: number
    • value: number

    Returns number

and

  • and(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number
  • Stores the bitwise AND of a value with the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

    Parameters

    • typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
    • index: number
    • value: number

    Returns number

compareExchange

  • compareExchange(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, expectedValue: number, replacementValue: number): number
  • Replaces the value at the given position in the array if the original value equals the given expected value, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

    Parameters

    • typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
    • index: number
    • expectedValue: number
    • replacementValue: number

    Returns number

exchange

  • exchange(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number
  • Replaces the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

    Parameters

    • typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
    • index: number
    • value: number

    Returns number

isLockFree

  • isLockFree(size: number): boolean
  • Returns a value indicating whether high-performance algorithms can use atomic operations (true) or must use locks (false) for the given number of bytes-per-element of a typed array.

    Parameters

    • size: number

    Returns boolean

load

  • load(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number): number
  • Returns the value at the given position in the array. Until this atomic operation completes, any other read or write operation against the array will block.

    Parameters

    • typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
    • index: number

    Returns number

notify

  • notify(typedArray: Int32Array, index: number, count: number): number
  • Wakes up sleeping agents that are waiting on the given index of the array, returning the number of agents that were awoken.

    Parameters

    • typedArray: Int32Array
    • index: number
    • count: number

    Returns number

or

  • or(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number
  • Stores the bitwise OR of a value with the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

    Parameters

    • typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
    • index: number
    • value: number

    Returns number

store

  • store(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number
  • Stores a value at the given position in the array, returning the new value. Until this atomic operation completes, any other read or write operation against the array will block.

    Parameters

    • typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
    • index: number
    • value: number

    Returns number

sub

  • sub(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number
  • Subtracts a value from the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

    Parameters

    • typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
    • index: number
    • value: number

    Returns number

wait

  • wait(typedArray: Int32Array, index: number, value: number, timeout?: undefined | number): "ok" | "not-equal" | "timed-out"
  • If the value at the given position in the array is equal to the provided value, the current agent is put to sleep causing execution to suspend until the timeout expires (returning "timed-out") or until the agent is awoken (returning "ok"); otherwise, returns "not-equal".

    Parameters

    • typedArray: Int32Array
    • index: number
    • value: number
    • Optional timeout: undefined | number

    Returns "ok" | "not-equal" | "timed-out"

xor

  • xor(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number
  • Stores the bitwise XOR of a value with the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

    Parameters

    • typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array
    • index: number
    • value: number

    Returns number

Generated using TypeDoc