diff options
author | dl <none@none> | 2015-05-20 14:50:57 +0200 |
---|---|---|
committer | dl <none@none> | 2015-05-20 14:50:57 +0200 |
commit | b08c027145a267930b9a9537c2ea14eed214e82f (patch) | |
tree | 2cb2de357c3e4b0b442eceeeccaaa6e0bbf57a2d /src/share/classes/java/util/concurrent | |
parent | 05b459faab02f6f7bb952ae49b43feb7b5b1ded3 (diff) | |
download | jdk8u_jdk-b08c027145a267930b9a9537c2ea14eed214e82f.tar.gz |
8080623: CPU overhead in FJ due to spinning in awaitWork
Reviewed-by: chegar, dholmes
Diffstat (limited to 'src/share/classes/java/util/concurrent')
-rw-r--r-- | src/share/classes/java/util/concurrent/ForkJoinPool.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/share/classes/java/util/concurrent/ForkJoinPool.java b/src/share/classes/java/util/concurrent/ForkJoinPool.java index 255a0b29db..b2a7d63016 100644 --- a/src/share/classes/java/util/concurrent/ForkJoinPool.java +++ b/src/share/classes/java/util/concurrent/ForkJoinPool.java @@ -1323,13 +1323,16 @@ public class ForkJoinPool extends AbstractExecutorService { /** * Number of times to spin-wait before blocking. The spins (in * awaitRunStateLock and awaitWork) currently use randomized - * spins. If/when MWAIT-like intrinsics becomes available, they - * may allow quieter spinning. The value of SPINS must be a power - * of two, at least 4. The current value causes spinning for a - * small fraction of typical context-switch times, well worthwhile - * given the typical likelihoods that blocking is not necessary. + * spins. Currently set to zero to reduce CPU usage. + * + * If greater than zero the value of SPINS must be a power + * of two, at least 4. A value of 2048 causes spinning for a + * small fraction of typical context-switch times. + * + * If/when MWAIT-like intrinsics becomes available, they + * may allow quieter spinning. */ - private static final int SPINS = 1 << 11; + private static final int SPINS = 0; /** * Increment for seed generators. See class ThreadLocal for |