3 ms·
On Mac they have used the Grand Central Dispatch library since 2009. So if developers already used that, they were ready for M1 https://en.wikipedia.org/wiki/Gr
by xcv123 3y ago
On Mac they have used the Grand Central Dispatch library since 2009. So if developers already used that, they were ready for M1 https://en.wikipedia.org/wiki/Grand_Central_Dispatch https://en.wikipedia.org/wiki/Grand_Central_Dispatch
- astrange 3y agoGCD was actually not designed for this scenario and it's easy to mess up with it. It was designed for a large number of equal cores (aka SMP), meaning people did dispatch_async to the default concurrent queues all over the place, which is a bad pattern when you have to shrink down to phone size. Also, dispatch_semaphore has priority inversions and a lot of other features (like dispatch_group) are semaphores in disguise. It does work if you use it carefully, but Swift concurrency is a different design for a reason.
- xcv123 3y agoAccording to Apple developer documentation GCD is currently designed for this scenario https://developer.apple.com/documentation/apple-silicon/tuning-your-code-s-performance-for-apple-silicon#Execute-Tasks-Using-Grand-Central-Dispatch https://developer.apple.com/documentation/apple-silicon/tuni... "On a Mac with Apple silicon, GCD takes into account the differences in core types, distributing tasks to the appropriate core type to get the needed performance or efficiency."
- astrange 3y agoIt is now, but that's mostly from evolution in the iOS era. But like I said, it's not perfect.
- krackers 3y agothat's probably assuming you set the qos correctly.
- astrange 3y agoAnd dispatch_async loses QoS while dispatch_sync keeps it, but people often used to async unnecessarily.
- krackers 3y ago>dispatch_async loses QoS Wait really? Where can I read more about this, this goes against what I would assume. Edit: Or do you mean that when dispatch_async the block is run with the QoS of target queue instead of source? That is what I would normally expect, if you want to "inherit priority" then dispatch_sync would do that, at the expense of blocking.