javadoc

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/9159e846
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/9159e846
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/9159e846

Branch: refs/heads/LOG4j2-494
Commit: 9159e84675699923505cecd11399f4f9bcad73eb
Parents: 287d2c6
Author: rpopma <[email protected]>
Authored: Thu Apr 21 14:22:02 2016 +0900
Committer: Ralph Goers <[email protected]>
Committed: Mon Apr 25 21:30:27 2016 -0700

----------------------------------------------------------------------
 .../log4j/core/async/perftest/IdleStrategy.java | 24 +-------------------
 .../core/async/perftest/NoOpIdleStrategy.java   |  7 ++++--
 2 files changed, 6 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9159e846/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java
----------------------------------------------------------------------
diff --git 
a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java
 
b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java
index eca115c..65b97df 100644
--- 
a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java
+++ 
b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/IdleStrategy.java
@@ -19,11 +19,6 @@ package org.apache.logging.log4j.core.async.perftest;
 /**
  * Idle strategy for use by threads when they do not have work to do.
  *
- * <h3>Note regarding implementor state</h3>
- *
- * Some implementations are known to be stateful, please note that you cannot 
safely assume implementations to be stateless.
- * Where implementations are stateful it is recommended that implementation 
state is padded to avoid false sharing.
- *
  * <h3>Note regarding potential for TTSP(Time To Safe Point) issues</h3>
  *
  * If the caller spins in a 'counted' loop, and the implementation does not 
include a a safepoint poll this may cause a TTSP
@@ -36,24 +31,7 @@ package org.apache.logging.log4j.core.async.perftest;
  */
 interface IdleStrategy {
     /**
-     * Perform current idle action (e.g. nothing/yield/sleep). To be used in 
conjunction with {@link IdleStrategy#reset()}
-     * to clear internal state when idle period is over (or before it begins). 
Callers are expected to follow this pattern:
-     *
-     * <pre>
-     * <code>while (isRunning) {
-     *   if (!hasWork()) {
-     *     idleStrategy.reset();
-     *     while (!hasWork()) {
-     *       if (!isRunning) {
-     *         return;
-     *       }
-     *       idleStrategy.idle();
-     *     }
-     *   }
-     *   doWork();
-     * }
-     * </code>
-     * </pre>
+     * Perform current idle action (e.g. nothing/yield/sleep).
      */
     void idle();
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/9159e846/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/NoOpIdleStrategy.java
----------------------------------------------------------------------
diff --git 
a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/NoOpIdleStrategy.java
 
b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/NoOpIdleStrategy.java
index ad5d280..6bce312 100644
--- 
a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/NoOpIdleStrategy.java
+++ 
b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/NoOpIdleStrategy.java
@@ -17,8 +17,11 @@
 package org.apache.logging.log4j.core.async.perftest;
 
 /**
- * Low-latency idle strategy to be employed in loops that do significant work 
on each iteration such that any work in the
- * idle strategy would be wasteful.
+ * No operation idle strategy.
+ * <p>
+ * This idle strategy should be prevented from being inlined by using a 
Hotspot compiler command as a JVM argument e.g:
+ * 
<code>-XX:CompileCommand=dontinline,org.apache.logging.log4j.core.async.perftest.NoOpIdleStrategy::idle</code>
+ * </p>
  */
 class NoOpIdleStrategy implements IdleStrategy {
 

Reply via email to