Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v5]

2023-02-24 Thread Brent Christian
On Fri, 24 Feb 2023 13:44:40 GMT, Alan Bateman wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v5]

2023-02-24 Thread Martin Buchholz
On Fri, 24 Feb 2023 13:44:40 GMT, Alan Bateman wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v4]

2023-02-24 Thread Alan Bateman
On Thu, 23 Feb 2023 16:36:46 GMT, Martin Buchholz wrote: >> Alan Bateman has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains seven additional >> com

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v5]

2023-02-24 Thread Alan Bateman
> Executors.newSingleThreadExecutor returns a delegating ExecutorService that > has finalizer to shutdown the underlying TPE when the wrapper is finalizable. > It goes back to JDK 6 and JDK-6399443. This is the last non-empty finalizer > in java.base. Removing it will likely lead to bug reports/

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v4]

2023-02-23 Thread Brent Christian
On Tue, 21 Feb 2023 20:27:44 GMT, Martin Buchholz wrote: >> jtreg will look after this. The default timeout is 120s but it can be >> adjusted with a timeout factor (make time uses a timeout factor of 4). So it >> would be possible to put a limit on this in the test but it can be >> problematic

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v4]

2023-02-23 Thread Martin Buchholz
On Thu, 23 Feb 2023 08:31:36 GMT, Alan Bateman wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v4]

2023-02-23 Thread Martin Buchholz
On Thu, 23 Feb 2023 08:31:36 GMT, Alan Bateman wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v4]

2023-02-23 Thread Martin Buchholz
On Thu, 23 Feb 2023 08:31:36 GMT, Alan Bateman wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v4]

2023-02-23 Thread Daniel Fuchs
On Thu, 23 Feb 2023 08:31:36 GMT, Alan Bateman wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v4]

2023-02-23 Thread Roger Riggs
On Thu, 23 Feb 2023 08:31:36 GMT, Alan Bateman wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v4]

2023-02-23 Thread Daniel Fuchs
On Thu, 23 Feb 2023 08:31:36 GMT, Alan Bateman wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v4]

2023-02-23 Thread Alan Bateman
> Executors.newSingleThreadExecutor returns a delegating ExecutorService that > has finalizer to shutdown the underlying TPE when the wrapper is finalizable. > It goes back to JDK 6 and JDK-6399443. This is the last non-empty finalizer > in java.base. Removing it will likely lead to bug reports/

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]

2023-02-22 Thread Brent Christian
On Wed, 22 Feb 2023 18:57:00 GMT, Alan Bateman wrote: >> The cleaning action would not have access to the isShutdown() instance >> method of the (Phantom-reachable) AutoShutdownDelegatedExecutorService. > >> The cleaning action would not have access to the isShutdown() instance >> method of the

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]

2023-02-22 Thread Alan Bateman
On Wed, 22 Feb 2023 18:41:13 GMT, Brent Christian wrote: > The cleaning action would not have access to the isShutdown() instance method > of the (Phantom-reachable) AutoShutdownDelegatedExecutorService. The cleaning action has a reference to the delegate (the underlying ExecutorService) so it

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]

2023-02-22 Thread Brent Christian
On Wed, 22 Feb 2023 18:02:46 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/util/concurrent/Executors.java line 844: >> >>> 842: @Override >>> 843: public void shutdown() { >>> 844: cleaner.clean(); >> >> Hmmm... so now shutdown no longer requires permi

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]

2023-02-22 Thread Alan Bateman
On Wed, 22 Feb 2023 17:20:21 GMT, Daniel Fuchs wrote: > Hmmm... so now shutdown no longer requires permission. You should probably > call super.shutdown() before invoking cleaner.clean(), assuming that > shutdown() can be called twice. You could modify the cleanup action to only > call shutdow

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]

2023-02-22 Thread Daniel Fuchs
On Wed, 22 Feb 2023 16:17:11 GMT, Alan Bateman wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]

2023-02-22 Thread Alan Bateman
> Executors.newSingleThreadExecutor returns a delegating ExecutorService that > has finalizer to shutdown the underlying TPE when the wrapper is finalizable. > It goes back to JDK 6 and JDK-6399443. This is the last non-empty finalizer > in java.base. Removing it will likely lead to bug reports/

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v3]

2023-02-22 Thread Alan Bateman
On Tue, 21 Feb 2023 19:38:08 GMT, Brent Christian wrote: >> Alan Bateman has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains five additional >> comm

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v2]

2023-02-21 Thread Martin Buchholz
On Tue, 21 Feb 2023 16:36:26 GMT, Alan Bateman wrote: >> test/jdk/java/util/concurrent/Executors/AutoShutdown.java line 133: >> >>> 131: while (!terminated) { >>> 132: System.gc(); >>> 133: terminated = executor.awaitTermination(100, >>> TimeUnit.MILLISECONDS); >

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v2]

2023-02-21 Thread Martin Buchholz
On Tue, 21 Feb 2023 18:24:05 GMT, Alan Bateman wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v2]

2023-02-21 Thread Brent Christian
On Tue, 21 Feb 2023 18:24:05 GMT, Alan Bateman wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor [v2]

2023-02-21 Thread Alan Bateman
> Executors.newSingleThreadExecutor returns a delegating ExecutorService that > has finalizer to shutdown the underlying TPE when the wrapper is finalizable. > It goes back to JDK 6 and JDK-6399443. This is the last non-empty finalizer > in java.base. Removing it will likely lead to bug reports/

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor

2023-02-21 Thread Martin Buchholz
On Mon, 20 Feb 2023 18:34:17 GMT, Alan Bateman wrote: > Executors.newSingleThreadExecutor returns a delegating ExecutorService that > has finalizer to shutdown the underlying TPE when the wrapper is finalizable. > It goes back to JDK 6 and JDK-6399443. This is the last non-empty finalizer > in

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor

2023-02-21 Thread Alan Bateman
On Tue, 21 Feb 2023 15:45:17 GMT, Viktor Klang wrote: >> Executors.newSingleThreadExecutor returns a delegating ExecutorService that >> has finalizer to shutdown the underlying TPE when the wrapper is >> finalizable. It goes back to JDK 6 and JDK-6399443. This is the last >> non-empty finalize

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor

2023-02-21 Thread Viktor Klang
On Mon, 20 Feb 2023 18:34:17 GMT, Alan Bateman wrote: > Executors.newSingleThreadExecutor returns a delegating ExecutorService that > has finalizer to shutdown the underlying TPE when the wrapper is finalizable. > It goes back to JDK 6 and JDK-6399443. This is the last non-empty finalizer > in

Re: RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor

2023-02-21 Thread Roger Riggs
On Mon, 20 Feb 2023 18:34:17 GMT, Alan Bateman wrote: > Executors.newSingleThreadExecutor returns a delegating ExecutorService that > has finalizer to shutdown the underlying TPE when the wrapper is finalizable. > It goes back to JDK 6 and JDK-6399443. This is the last non-empty finalizer > in

RFR: 8302899: Executors.newSingleThreadExecutor can use Cleaner to shutdown executor

2023-02-21 Thread Alan Bateman
Executors.newSingleThreadExecutor returns a delegating ExecutorService that has finalizer to shutdown the underlying TPE when the wrapper is finalizable. It goes back to JDK 6 and JDK-6399443. This is the last non-empty finalizer in java.base. Removing it will likely lead to bug reports/complain