Testing concurrent code
How do you reproduce or detect a data race in concurrent code that uses actors and Tasks?
How do you reproduce or detect a data race in concurrent code that uses actors and Tasks?
Swift 6 strict concurrency blocks most Sendable violations at compile time, and what's left shows up in a stress test that calls the same code hundreds of times from a TaskGroup with Thread Sanitizer on, which reports the race with a stack. Read actor state with await to verify it.
ConcurrencyShort answerBasics
This code gets called from several threads, and count comes out lower than expected. Can…
#actor #data-race
ConcurrencyMultiple choiceAdvanced
Under Swift 6 strict concurrency, which of the following are treated as Sendable (or…
#actor #sendable
ConcurrencyShort answerAdvanced
How does Thread Sanitizer actually catch data races?
#data-race #thread-sanitizer
ConcurrencyShort answerBasics
In Swift, what's the difference between a class and an actor?
#actor #swift-concurrency