Skip to content

sync/atomic: add Uint64Pair #61236

Open
Open
@haraldrudell

Description

I suggest CAS2 is implemented in the atomic package similar to atomic.align64, operational for hardware that supports it.

possibly also:

  • atomic OR
  • LL/SC Load-link/store-conditional

  • With the 2022 memory model, go1.19 atomics became useful after years of unproductive near-sighted discussions
  • However, wait-free algorithms now use CAS2, ie. 128-bit atomic, which is supported on most cpus but not in Go
  • implementing CAS spinners in lock-free applications produces long thread wait-times or 100% cpu, so wait-free is better: threads are neither suspended or spinning. We will have 100 cores and 100 GiB RAM from Apple soon enough
  • what is desired is a performant wait-free queue and wait-free free-list stack
  • fast-path of wCQ Nikolaev Ravindran 2022 and wfq Yang Mellor-Crummey 2016
  • this would enable an initial thread-pool to have wait-free and allocation-free data sink

darwin-arm64 darwin-amd64 linux-amd64

I think also atomic generics could do with another polish
Like this AtomicMax that is more flexible in what underlying integer types and named types can be used: https://github.com/haraldrudell/parl/blob/main/atomic-max.go

  • by inventing align64 only in atomic, 64-bit things must go in atomic

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

  • Status

    Accepted

Relationships

None yet

Development

No branches or pull requests

Issue actions