It's up to the programmer-user to impose thread-safety around an array or
other data structure. The compiler doesn't know if you want to allow multiple
threads to write and read multiple array members, or prevent all but one thread
to read and write multiple array members, or allow multiple rea
What about double checking?
Something like that
if counter != 0 { throw exc }
counter += 1if counter != 1 { throw exc }counter += 1
I think the performance penalty is just a check and an increment
It could be disabled after optimization or in release version to increase
performance
من: G
That sounds expected to me. While Array values are thread-safe, writing to the
global variable 'array' from two different threads would be a race. You can see
this properly diagnosed if you enable Thread Sanitizer.
Jordan
P.S. bugs.swift.org should be back up now, if you find any other issues.