Hi, I fall into the same issues. My thoughts that as community we need more robust guidelines and best practices to address these issues, though. Seems that Swift 6 will also help to eliminate many of them.
actor A
and class B
performs their Tasks concurrently, so there will be concurrent calls to nonSendable.inc()
and data race as a result.
Can you please specify how @isolated(local)
defined in actor A
and class B
will help prevent data races caused by concurrent calls to instance of class NonSendable
(nonSendable.inc()
method)?
There is also active review of @isolated(any)
now: SE-0431: `@isolated(any)` Function Types