Found 16 articles tagged with #concurrency

A deep dive into @MainActor in Swift

This is a global actor that describes the main thread, pretty handy given how often you need to make quick changes that update the user interface.

Apr 24, 2024#swift#concurrency

Data Race vs Race Condition in Swift

A data race is when two threads access the same mutable object without synchronization, while a race condition is when the order of events affects the correctness of the program.

May 24, 2023#swift#concurrency

Swift actor isolated vs nonisolated

Swift actor isolation is a feature of Swift concurrency that allows actors to protect their state from concurrent access by other actors or….

Apr 02, 2023#swift#concurrency

Swift Task Groups

Swift task groups (TaskGroup, ThrowingTaskGroup) are a feature introduced in Swift 5.5 that allow you to create and manage a collection of….

Mar 31, 2023#swift#concurrency

Swift Task.init vs Task.detached

A task can run in the background and communicate with the UI thread when needed. To create and run a task in Swift, you can use initializers Task.init vs Task.detached.

Mar 31, 2023#swift#concurrency

Swift Async/Await

Swift async/await is a new programming model introduced in Swift 5.5 (released on September 20, 2021) for writing asynchronous code that is….

Mar 28, 2023#concurrency#swift

The Problems with Completion Handlers in Swift

Asynchronous programming is an essential part of modern software development, allowing applications to perform long-running tasks without….

Mar 28, 2023#concurrency#swift

Swift Sendable protocol and @Sendable attribute

We need a way to differentiate between the cases that are safe to transfer between concurrency domains and those that are not.

Mar 11, 2023#swift#concurrency

Swift Continuations

Asynchronous tasks can suspend themselves on continuations which synchronous code can then capture and invoke to resume the task in response to an event.

Mar 10, 2023#swift#concurrency

Swift Async Sequences

The new AsyncSequence protocol enables a natural, simple syntax for iterating over a sequence of values over time as easy as writing a `for` loop.

Mar 08, 2023#swift#concurrency