withCheckedContinuation vs withUnsafeContinuation in Swift
Continuations bridge completion-handler APIs into async/await. The checked variant catches the two ways you can get it wrong, and the unsafe one trusts you completely.
// 16 articles available
Continuations bridge completion-handler APIs into async/await. The checked variant catches the two ways you can get it wrong, and the unsafe one trusts you completely.
Swift 6's data-race safety is real, but it has blind spots. Here are the places the compiler can't see, and how to stop treating a clean build as proof your code is thread safe.
OSAllocatedUnfairLock wraps os_unfair_lock with a closure-based API that makes it impossible to forget to unlock and keeps the lock's storage alive for as long as you need it.
SE-0493 finally lets you write defer { await cleanup() } in async functions, without spawning a detached task or threading cleanup logic through every return path.
Swift 6.4's withTaskCancellationShield lets cleanup code run to completion even after a task has been cancelled, without spawning extra unstructured tasks.
Swift 6.2 changes how async functions pick a thread by default. The new @concurrent attribute lets you explicitly opt into background execution when you actually need it.
Master Swift's TaskGroup for parallel async work with proper cancellation, error handling, and result collection. Learn common patterns for batch operations and concurrent pipelines.
Apple released Swift System Metrics 1.0, a package that collects process-level metrics like CPU time, memory usage, and file descriptors with a unified API across Linux and macOS.
Swift offers actors, GCD, and locks for thread safety. Each solves the same problem differently. Here's how to choose.
Actors provide compile-time safety for shared mutable state in Swift. Here's when to use them and how they compare to older approaches.
Grand Central Dispatch remains a practical choice for thread safety in Swift, especially when you need synchronous access or are working with legacy code.
Locks offer the lowest overhead for thread synchronization in Swift. Here's when that matters and how to use them safely.
A practical introduction to async/await in Swift, covering the fundamentals you need to write concurrent code that's both safe and readable.
Both async/await and Grand Central Dispatch solve concurrency problems, but they approach them differently. Here's how to choose between them.
Before Swift closures, Objective-C had blocks. The syntax is different, but the power is the same. Here's how to use them effectively.
Learn how dispatch barrier queues provide elegant reader-writer synchronization in Objective-C without explicit locks or semaphores.