Free preview.You're sampling one lesson — enroll free to unlock all 8 lessons and track your progress.
Enroll free
lesson

Concurrency vs. Parallelism

Concurrency vs. Parallelism

In this lesson — part of Concurrency Basics — you'll learn concurrency vs. parallelism in Swift and why it matters in real work.

Why it matters

Modern programs wait on networks and disks — async lets them stay responsive.

Key ideas

  • Blocking vs. non-blocking
  • Callbacks, promises, async/await
  • Concurrency vs. parallelism
  • Error handling in async code

In practice

Here's how it looks in idiomatic Swift:

func fetchUser() async -> String {
    return "Ada"
}
Task {
    let user = await fetchUser()
    print(user)
}

Swift note: Swift's concurrency uses async/await; you call async functions with await, and a Task { } bridges from synchronous code into an async context.

Try it yourself

Exercise: In Swift, fetch two things concurrently and combine the results.

Recap

You now understand concurrency vs. parallelism and can apply it in Swift. Mark this lesson complete and continue to the next one.