[swift-users] Any equivalent to Java's AtomicInteger?

Hooman Mehr hooman at mac.com
Tue Nov 22 12:30:59 CST 2016


Standard library source code already includes internal atomic counters. Introducing these apparently is on the agenda but post Swift 4.0 as part of a general language level support for concurrency. For now, the preferred API for such things is GCD (Grand Central Dispatch) provided through Dispatch module on macOS and Linux. 

> On Nov 21, 2016, at 7:55 PM, Rick Mann via swift-users <swift-users at swift.org> wrote:
> 
> A lot of architectures provide CPU support for atomic increment and the like. <stdatomic.h> does, too, but most of it is unavailable in Xcode 8.1.
> 
> Is there a Swift AtomicInteger? Is that worth adding to the language?
> 
> -- 
> Rick Mann
> rmann at latencyzero.com
> 
> 
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users



More information about the swift-users mailing list