4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-22 00:38:06 +08:00

Cygwin: cygthread: stop running all cygthreads at HIGHEST priority.

Given the number of scenarios we're using cygthreads, it just doesn't
make sense to run all of them with HIGHEST priority in preemptive
obedience.

Drop setting the cygthread priority and let the cygthreads decide
by themselves.  For the time being, run all cygthreads with normal
priority.  Change this locally in the thread function, if required.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2024-12-06 19:41:35 +01:00
parent ad919e0535
commit 376fe1dab1
2 changed files with 4 additions and 2 deletions

View File

@ -271,7 +271,10 @@ cygthread::async_create (ULONG_PTR arg)
{
cygthread *that = (cygthread *) arg;
that->create ();
::SetThreadPriority (that->h, THREAD_PRIORITY_HIGHEST);
/* We used to set the priority to HIGHEST here, but most cygthreads don't
require such a high priority. Keep the priority at NORMAL here and let
the thread function decide by itself if it needs a higher or lower
priority, based on the task it performs. */
that->zap_h ();
}

View File

@ -1345,7 +1345,6 @@ wait_sig (VOID *)
hntdll = GetModuleHandle ("ntdll.dll");
SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_NORMAL);
for (;;)
{
DWORD nb;