1

Our game uses a CADisplayLink and OpenGLEs2.0 to try to render at 60fps. We have a few threads running too, to handle server calls, background loading, etc. I'm trying to optimise the background file loading and on a test if the priority is set to 0.5 - which seems to be the default - then it can load quickly, it can seem to slow right down and take 2-3 x as long, whereas if I set it to 0.8, it seems to always work quickly, but occasionally then it causes the CADisplayLink to miss firing at the correct time. If I set the priority to 1.0 it's barely faster but misses the CADisplaylink quite often. I'm nervous that this value is a bit arbitrary and may work differently on different devices.

I've read that there are other settings - QualityOfService and QueuePriority. Should I be using those as well as, or instead of the threadpriority. Should these values be set on the main thread ? How does the IOS decide how much time to give to each thread ?

Thanks

Shaun

user3162134
  • 287
  • 1
  • 10
  • In [Building Responsive and Efficient Apps with GCD](https://developer.apple.com/videos/play/wwdc2015/718/) Apple suggests that QoS is a more encompassing mechanism that will impact many different considerations (e.g. “CPU scheduling priority, I/O priority, timer coalescing, CPU throughput vs efficiency, and more”) uniquely configured “for each platform/device”. I’d suggest using QoS (and refrain from adjusting thread priorities yourself), if possible. If you need more fine grained adjustments to QoS, you can set relative priorities within a given QoS, too. – Rob Apr 13 '20 at 16:33
  • See [Concurrent Programming With GCD in Swift 3](https://developer.apple.com/videos/play/wwdc2016/720/) for QoS in a more contemporary Swift syntax. – Rob Apr 13 '20 at 16:34

0 Answers0