Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSwiftactors and actor isolationSingle-choice MCQ

Inside a method of an `actor`, code reads `self.count`, then `await someOtherActor.value`, then reads `self.count` again. Why can the second `self.count` read observe a different value than the first?

actor Counter { var count = 0 func work(_ other: Other) async { let a = count _ = await other.value let b = count // b may differ from a } }