-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename EWYK The AdaptiveExecutionStrategy #6353
Conversation
Rename EWYK The AdaptiveExecutionStrategy, which better represents the nature of the strategy. Signed-off-by: Greg Wilkins <[email protected]>
Rename EWYK The AdaptiveExecutionStrategy, which better represents the nature of the strategy. Signed-off-by: Greg Wilkins <[email protected]>
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
Updated the documentation from review, but in so doing realised that the sub-strategy selection could be more simply represented in code, so that was also updated. Signed-off-by: Greg Wilkins <[email protected]>
Updated the documentation from review, but in so doing realised that the sub-strategy selection could be more simply represented in code, so that was also updated. Signed-off-by: Greg Wilkins <[email protected]>
Updated the documentation from review, but in so doing realised that the sub-strategy selection could be more simply represented in code, so that was also updated. Signed-off-by: Greg Wilkins <[email protected]>
Added notes about chaining strategies and thread starvation Signed-off-by: Greg Wilkins <[email protected]>
Fixed formatting and made a little clearer Signed-off-by: Greg Wilkins <[email protected]>
Added deprecated version of EWYK Signed-off-by: Greg Wilkins <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/EatWhatYouKill.java
Outdated
Show resolved
Hide resolved
Updates from review Signed-off-by: Greg Wilkins <[email protected]>
jetty-util/src/main/java/org/eclipse/jetty/util/thread/AutoLock.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
Updates from review Signed-off-by: Greg Wilkins <[email protected]>
version without code duplication Signed-off-by: Greg Wilkins <[email protected]>
@sbordet I have pushed a version without the lock hack that well matches the documented algorithm. Note also with this forumulation there is one less test the common case for a non-blocking task, so it will take a much simpler path. The cost is that for the case of an potentially blocking task when there are no pending producers available, then the taskType is checked twice. This double check can be removed, but only by breaking out the EITHER and BLOCKING cases and thus duplicating the synchronized block and changing the flow from the documentation... but that may also be OK.... I'll add it as a comment to compare. |
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
Even more comments Some duplicated code to avoid double test on taskType Signed-off-by: Greg Wilkins <[email protected]>
hide the Runnable interface from the strategy signature Signed-off-by: Greg Wilkins <[email protected]>
@sbordet nudge... let's get this merged long before next release train |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good apart niggles in the comment/javadocs.
Since many javadocs were added, a general rule for javadocs is that they should be written in 3rd person, therefore "Selects a sub-strategy" rather than "Select a sub-strategy", "Runs" rather than "Run", etc.
See:
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#styleguide
https://blog.joda.org/2012/11/javadoc-coding-standards.html
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
jetty-util/src/main/java/org/eclipse/jetty/util/thread/strategy/AdaptiveExecutionStrategy.java
Outdated
Show resolved
Hide resolved
niggles for javadoc Signed-off-by: Greg Wilkins <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all javadocs were put in 3rd person, it's just to have a little more consistency, but I don't want to annoy too much. LGTM.
more niggles for javadoc Signed-off-by: Greg Wilkins <[email protected]>
Fixed javadoc 3rd person forms. Removed stale references to doProduce() method. Using IO.close(Closeable). Other small cosmetic changes. Signed-off-by: Simone Bordet <[email protected]>
@sbordet nudge |
@gregw I made further changes to the javadocs, see my commit. |
* @return True if the sub-strategy requires the caller to continue to produce tasks. | ||
*/ | ||
private boolean consumeTask(Runnable task, SubStrategy subStrategy) | ||
{ | ||
// Consume and/or execute task according to the selected mode. | ||
if (LOG.isDebugEnabled()) | ||
LOG.debug("{} ss={} t={}/{} {}", this, subStrategy, task, Invocable.getInvocationType(task)); | ||
LOG.debug("ss={} t={}/{} {}", subStrategy, task, Invocable.getInvocationType(task), this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbordet this is now inconsistent with the other debugs in the class.... but I guess that is not so important.
Rename EWYK to AdaptiveExecutionStrategy, which better represents the nature of the strategy.
#6391
Signed-off-by: Greg Wilkins [email protected]