ReactiveCocoa: Atomic: SPINLOCK is not safe in iOS
https://twitter.com/steipete/status/676851647042203648
I’ll refrain from making any comments (I’ll just say… if it’s illegal on iOS, why is it a public API???)
Apparently pthread mutexes are faster now. We should create a benchmark to compare, and try to convert Atomic to this (also RACCompoundDisposable and RACSerialDisposable?)
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 20 (13 by maintainers)
I found out this thread today, and made an investigation of different types of synchronization and did execute a benchmark on iOS simulator and real devices. The results are very interesting for me. In iOS 10 we have visible performance degradation of dispatch_semaphore, which is probably changed his behaviour with thread priority respect. Here is the summary diagram of basic synchronization mechanisms available in iOS. All tests run with release configuration (Swift optimization -O)
Benchmark code for SDK9 Benchmark code for SDK10
I’m not even sure what “illegal” means.