-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b08
-
generic
-
generic
-
Not verified
This program:
----------------
import java.util.*;
import java.util.concurrent.*;
public class Perf {
public static void main(String[] args) throws Throwable {
final int n = 3;
final ScheduledThreadPoolExecutor pool
= new ScheduledThreadPoolExecutor(3);
pool.setExecuteExistingDelayedTasksAfterShutdownPolicy(true);
ScheduledFuture<?> future = pool.schedule(
new Runnable() { public void run() {
System.out.println("Hey!");}},
1L, TimeUnit.MINUTES);
pool.shutdown();
pool.awaitTermination(1L, TimeUnit.HOURS);
}
}
----------------
uses up lots of CPU:
jver mustang jr Perf
==> javac -source 1.6 -Xlint:all Perf.java
==> java -esa -ea Perf
Hey!
jver mustang jr Perf 48.45s user 0.42s system 75% cpu 1:04.44 total
----------------
import java.util.*;
import java.util.concurrent.*;
public class Perf {
public static void main(String[] args) throws Throwable {
final int n = 3;
final ScheduledThreadPoolExecutor pool
= new ScheduledThreadPoolExecutor(3);
pool.setExecuteExistingDelayedTasksAfterShutdownPolicy(true);
ScheduledFuture<?> future = pool.schedule(
new Runnable() { public void run() {
System.out.println("Hey!");}},
1L, TimeUnit.MINUTES);
pool.shutdown();
pool.awaitTermination(1L, TimeUnit.HOURS);
}
}
----------------
uses up lots of CPU:
jver mustang jr Perf
==> javac -source 1.6 -Xlint:all Perf.java
==> java -esa -ea Perf
Hey!
jver mustang jr Perf 48.45s user 0.42s system 75% cpu 1:04.44 total
- relates to
-
JDK-6576792 ThreadPoolExecutor methods leak interrupts when run in pool threads
-
- Resolved
-