Did GCD change in macOS 26

Some users of my Mac app are complaining of redrawing delays. Based on what I see in logs, my GCD timer event handlers are not being run in a timely manner although the runloop is still pumping events: sometimes 500ms pass before a 15ms timer runs. During this time, many keypresses are routed through -[NSApplication sendEvent:], which is how I know it's not locked up in synchronous code.

This issue has not been reported in older versions of macOS.

I start the timer like this:

_gcdUpdateTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());
dispatch_source_set_timer(_gcdUpdateTimer,
                          dispatch_time(DISPATCH_TIME_NOW, period * NSEC_PER_SEC),
                          period * NSEC_PER_SEC,
                          0.0005 * NSEC_PER_SEC);
dispatch_source_set_event_handler(_gcdUpdateTimer, ^{
    …redraw…
});

The answer to the question of “Did GCD change in macOS X” is always “Yes.” Major macOS releases are… well… major, and lots of stuff changes there. Moreover, macOS is composed of many different interacting subsystems, and it’s common for a problem with API Y to be caused by underlying subsystem Z. This is especially true when it comes to performance.

As to your specific issue, it’s hard to say what’s going on with more context. First things first, can you reproduce this yourself? Or are you basing this solely on user reports and what you “see in logs”?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Did GCD change in macOS 26
 
 
Q