* Increase default maxThreads value to 50 (evauators aren't that expensive anymore)
* Some minor code cleanup
This commit is contained in:
parent
21838fe606
commit
a874998ffb
1 changed files with 8 additions and 8 deletions
|
@ -550,12 +550,15 @@ public final class Application implements Runnable {
|
||||||
try {
|
try {
|
||||||
return (RequestEvaluator) freeThreads.pop();
|
return (RequestEvaluator) freeThreads.pop();
|
||||||
} catch (EmptyStackException nothreads) {
|
} catch (EmptyStackException nothreads) {
|
||||||
int maxThreads = 12;
|
int maxThreads = 50;
|
||||||
|
|
||||||
try {
|
String maxThreadsProp = props.getProperty("maxThreads");
|
||||||
maxThreads = Integer.parseInt(props.getProperty("maxThreads"));
|
if (maxThreadsProp != null) {
|
||||||
} catch (Exception ignore) {
|
try {
|
||||||
// property not set, use default value
|
maxThreads = Integer.parseInt(maxThreadsProp);
|
||||||
|
} catch (Exception ignore) {
|
||||||
|
logEvent("Couldn't parse maxThreads property: " + maxThreadsProp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
@ -628,10 +631,7 @@ public final class Application implements Runnable {
|
||||||
for (int i = 0; i < toBeDestroyed; i++) {
|
for (int i = 0; i < toBeDestroyed; i++) {
|
||||||
try {
|
try {
|
||||||
RequestEvaluator re = (RequestEvaluator) freeThreads.pop();
|
RequestEvaluator re = (RequestEvaluator) freeThreads.pop();
|
||||||
|
|
||||||
allThreads.removeElement(re);
|
allThreads.removeElement(re);
|
||||||
|
|
||||||
// typemgr.unregisterRequestEvaluator (re);
|
|
||||||
re.stopTransactor();
|
re.stopTransactor();
|
||||||
} catch (EmptyStackException empty) {
|
} catch (EmptyStackException empty) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue