-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move properties to nonatomic #49
Comments
To support my argument of dropping atomicity for properties, this is Mike Ash's thoughts, taken from a blog post on locking and Swift.
let checkingAccount = Account(amount: 100)
let savingsAccount = Account(amount: 0)
checkingAccount.withDraw(100)
savingsAccount.deposit(100)
println("Your total balance is: \(checkingAccount.amount + savingsAccount.amount)")
Add to that the fact that every accessor and setter is essentially running in a recursive blocking lock, which is not cheap computationally. They really should be largely (or wholly) moved to non-atomic, and the entire proxy should be rebuilt with thread safety in mind. |
Changing properties to non atomic will likely require a full re-validation of the iOS library so we're marking this as future and epic for now |
Merged into develop. |
Not having any sort of threading is a separate (larger) issue, but that every property is atomic is going to slow the library down quite a bit. Most (or all, if we do our threading properly) things should be nonatomic.
The text was updated successfully, but these errors were encountered: