Skip to content
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

Use -spinStyle instead of -yield #39

Merged
merged 3 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
/*.iml
/classes
/out
/.settings
/.project
/.classpath
/bin
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ If you need to customize the configuration, add a block like the following to co
jcstress {
verbose = true
timeMillis = "200"
yield = true
spinStyle = "THREAD_YIELD"
}
```

Expand All @@ -62,7 +62,7 @@ These are all possible configuration options:
| `regexp` | Regexp selector for tests. |
| `timeMillis` | Time to spend in single test iteration. Larger value improves test reliability, since schedulers do better job in the long run. |
| `verbose` | Be extra verbose. |
| `yield` | Call `Thread.yield()` in busy loops. |
| `spinStyle` | `HARD` = hard busy loop; `THREAD_YIELD` = use `Thread.yield()`; `THREAD_SPIN_WAIT` = use `Thread.onSpinWait()`; `LOCKSUPPORT_PARK_NANOS` = use `LockSupport.parkNanos()`. |

More options are available, but you probably won't need them:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class JcstressPluginExtension {
private String regexp;
private String timeMillis;
private String verbose;
private String yield;
private String spinStyle;

public JcstressPluginExtension(final Project project) {
this.project = project;
Expand All @@ -50,7 +50,7 @@ public List<String> buildArgs() {
addParameter(result, "-t", regexp);
addParameter(result, "-time", timeMillis);
addParameter(result, "-v", verbose);
addParameter(result, "-yield", yield);
addParameter(result, "-spinStyle", spinStyle);
return result;
}

Expand Down Expand Up @@ -200,11 +200,11 @@ public void setVerbose(String verbose) {
this.verbose = verbose;
}

public String getYield() {
return yield;
public String getSpinStyle() {
return spinStyle;
}

public void setYield(String yield) {
this.yield = yield;
public void setSpinStyle(String spinStyle) {
this.spinStyle = spinStyle;
}
}