1
0
mirror of https://github.com/golang/go synced 2024-11-23 17:00:07 -07:00

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://golang.org/cl/134360043
This commit is contained in:
Alex Brainman 2014-09-03 14:17:04 +10:00
parent 9aa7d136f5
commit 2c780a35b9

View File

@ -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);