diff options
author | Alex Brainman <alex.brainman@gmail.com> | 2014-09-03 14:17:04 +1000 |
---|---|---|
committer | Alex Brainman <alex.brainman@gmail.com> | 2014-09-03 14:17:04 +1000 |
commit | 2b83962f41c8b35ea5ee37676d1e4dab2c1e85cc (patch) | |
tree | 30916fd7c3adbb4b1329c92b28dff6d9cf8a142a /src/pkg | |
parent | 7ef25c4b55ce76095ff6750ca93bb0d29d7b5a7f (diff) | |
download | go-2b83962f41c8b35ea5ee37676d1e4dab2c1e85cc.tar.gz |
runtime: increase windows prof thread priority sooner
If system is busy burning cpu, it takes long time (about 300ms on
windows builders) to adjust prof thread priority. Once adjusted, prof
thread runs ahead of everyone else, but due to initial slowness, it
does not capture prof snapshots until start-up period is completed.
Change prof thread priority sooner, so it can start captures straight
away.
LGTM=dvyukov
R=golang-codereviews, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/134360043
Diffstat (limited to 'src/pkg')
-rw-r--r-- | src/pkg/runtime/os_windows.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pkg/runtime/os_windows.c b/src/pkg/runtime/os_windows.c index 43026d645..172fd9228 100644 --- a/src/pkg/runtime/os_windows.c +++ b/src/pkg/runtime/os_windows.c @@ -570,6 +570,7 @@ runtime·resetcpuprofiler(int32 hz) runtime·atomicstorep(&profiletimer, timer); thread = runtime·stdcall6(runtime·CreateThread, (uintptr)nil, (uintptr)nil, (uintptr)runtime·profileloop, (uintptr)nil, (uintptr)nil, (uintptr)nil); + runtime·stdcall2(runtime·SetThreadPriority, (uintptr)thread, THREAD_PRIORITY_HIGHEST); runtime·stdcall1(runtime·CloseHandle, (uintptr)thread); } runtime·unlock(&lock); |