patch 9.1.1748: macOS: Default scheduler priority too low

Problem:  macOS: Default scheduler priority too low
Solution: Explicitly set TASK_DEFAULT_APPLICATION scheduler priority
          to improve responsiveness (Luna Razzaghipour).

closes: #18120

Signed-off-by: Luna Razzaghipour <luna@xoria.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Luna Razzaghipour
2025-09-10 03:55:51 -04:00
committed by Christian Brabandt
parent 306a138172
commit 4bf0f6c1df
5 changed files with 21 additions and 3 deletions

View File

@ -46,6 +46,11 @@
#include <time.h>
#include <dirent.h>
/*
* Mach interface
*/
#include <mach/task.h>
/*
* MacOS specific #define
*/

View File

@ -3676,6 +3676,15 @@ mch_early_init(void)
signal_stack = alloc(get_signal_stack_size());
init_signal_stack();
#endif
/*
* Inform the macOS scheduler that Vim renders UI, and so shouldnt have its
* threads quality of service classes clamped.
*/
#ifdef MACOS_X
integer_t policy = TASK_DEFAULT_APPLICATION;
task_policy_set(mach_task_self(), TASK_CATEGORY_POLICY, &policy, 1);
#endif
}
#if defined(EXITFREE) || defined(PROTO)

View File

@ -724,6 +724,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1748,
/**/
1747,
/**/