[swift-evolution] [pitch] Atomics

Zach Waldowski zach at waldowski.me
Fri Feb 24 14:29:51 CST 2017


Huge +1, and for the prototype as well. Atomic.Bool and
Atomic.RawPointer would also be truly appreciated. An Atomic<T> a la C++
would be even better but I don't know if we'd want to tie ourselves to
that.

I like the LLVM names for MemoryOrder et. al. better than the C std.
ones, in general, and have never liked acqrel.

Cheers! Awesome! Amazing! <3 <3 <3
  Zachary Waldowski
  zach at waldowski.me

On Thu, Feb 23, 2017, at 04:44 PM, Guillaume Lessard via swift-evolution
wrote:
> There is no clean way to use atomic operations in Swift at the moment,
> even less so after most of OSAtomic.h was deprecated in Sierra. Of
> course, the OSAtomic calls were never available in Linux, so there are no
> atomics at all on that side. It's technically possible to wrap clang’s
> C11 atomics for use in Swift; such a wrapper can be made cross-platform,
> but still isn't a particularly great solution.
> 
> It looks to me as if this would pretty much be a library addition, since
> atomics support seems to be fairly complete in the Builtin module. Would
> a proposal be welcome?
> 
> I sketched an atomic Int64 in the following branch:
> https://github.com/glessard/swift/tree/atomics-sketch
> 
> Cheers,
> Guillaume Lessard
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution


More information about the swift-evolution mailing list