[swift-evolution] [pitch] Atomics

Anton Mironov antonvmironov at gmail.com
Fri Feb 24 13:36:09 CST 2017


+1

But I would also suggest using Int instead of Int64 in public interface.

> On Feb 23, 2017, at 23:44, Guillaume Lessard via swift-evolution <swift-evolution at swift.org> 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