projects
/
platform
/
upstream
/
dotnet
/
runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c16c736
)
Remove contention from HandleHistogramProfileRand (#81932)
author
Egor Bogatov
<egorbo@gmail.com>
Fri, 10 Feb 2023 11:28:13 +0000
(12:28 +0100)
committer
GitHub
<noreply@github.com>
Fri, 10 Feb 2023 11:28:13 +0000
(12:28 +0100)
src/coreclr/vm/jithelpers.cpp
patch
|
blob
|
history
diff --git
a/src/coreclr/vm/jithelpers.cpp
b/src/coreclr/vm/jithelpers.cpp
index
2628f56
..
a6d41ca
100644
(file)
--- a/
src/coreclr/vm/jithelpers.cpp
+++ b/
src/coreclr/vm/jithelpers.cpp
@@
-5407,12
+5407,12
@@
void JIT_PartialCompilationPatchpoint(int* counter, int ilOffset)
static unsigned HandleHistogramProfileRand()
{
- //
g
enerate a random number (xorshift32)
+ //
G
enerate a random number (xorshift32)
//
- //
intentionally simple so we can have multithreade
d
- //
access w/o tearing state
.
+ //
Intentionally simple for faster random. It's stored in TLS to avoi
d
+ //
multithread contention
.
//
- static
volatile
unsigned s_rng = 100;
+ static
thread_local
unsigned s_rng = 100;
unsigned x = s_rng;
x ^= x << 13;