15 points · by mpweiher · 7y ago · 6 comments
It boils down to "I did a read-modify-write without a lock, now there is a bug". Of course there is! that's what locks are for!
The swift value system and copy-on-write do not somehow absolve you from locking.
So the race isn’t because COW over struct in swift isn’t atomic ( it is), but because he uses a class and tries to build cow over it ( but does so improperly) ?