[ruby-core:119868] [Ruby master Feature#17566] Tune thread QoS / efficiency on macOS

Issue #17566 has been updated by shan (Shannon Skipper). From Apple's perspective, it's our "obligation" as developers to make apps go "absolutely idle" on performance cores when "not responding to user input." From their docs, it seems they hope for us to use fine grained priority when we can. See https://developer.apple.com/news/?id=vk3m204o Apple silicon is so popular with programmers that I wonder if it's worth supporting QoS for the sake of developer tools written in Ruby? ---------------------------------------- Feature #17566: Tune thread QoS / efficiency on macOS https://bugs.ruby-lang.org/issues/17566#change-110559 * Author: mperham (Mike Perham) * Status: Open ---------------------------------------- Hi, new Apple M1 processors have "performance" and "efficiency" cores. Apple provides a QoS API so threads can tune which cores they should execute on. Some threads should be executed as high-priority, some should be treated as low-priority. This page shows the pthread APIs that Apple provides: https://developer.apple.com/library/archive/documentation/Performance/Concep... ``` pthread_set_qos_class_self_np(QOS_CLASS_BACKGROUND, 0) ``` I noticed Ruby already provides `Thread#priority=` which says `This is just hint for Ruby thread scheduler. It may be ignored on some platform`. Does this API work still or was it only active for Ruby 1.8's green threads? Should this API use the QoS APIs on macOS? -- https://bugs.ruby-lang.org/
participants (1)
-
shan (Shannon Skipper)