Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #30483

shutdown executor service

X-Received by 10.42.52.208 with SMTP id k16mr13734750icg.23.1417704140903; Thu, 04 Dec 2014 06:42:20 -0800 (PST)
X-Received by 10.140.95.182 with SMTP id i51mr34509qge.12.1417704140831; Thu, 04 Dec 2014 06:42:20 -0800 (PST)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!h15no4413916igd.0!news-out.google.com!n9ni15qai.0!nntp.google.com!s7no4081484qap.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Thu, 4 Dec 2014 06:42:20 -0800 (PST)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=192.176.1.94; posting-account=1c_fOgoAAADuOXlL0A4-T9PUmVHtMSYd
NNTP-Posting-Host 192.176.1.94
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <2db503bb-a8ea-478a-a623-d1ac65e6dbb7@googlegroups.com> (permalink)
Subject shutdown executor service
From mike <mikaelpetterson@hotmail.com>
Injection-Date Thu, 04 Dec 2014 14:42:20 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.java.programmer:30483

Show key headers only | View raw


Hi,

I found the following code in our code base in the same class.


private final ExecutorService executor = Executors.newCachedThreadPool();

List<Future<T>> startExcuting() {
        try {
            return executor.invokeAll(Lists.newArrayList(tasks));
        } catch (InterruptedException e) {
            throw new AppException("startExcuting interrupted", e);
        } finally {
            tasks.clear();
           

        }
    }


My question is: Should we not have  executor.shutdown(); or threads might live longer. Is that correct?

//mike

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

shutdown executor service mike <mikaelpetterson@hotmail.com> - 2014-12-04 06:42 -0800
  Re: shutdown executor service Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-12-04 10:00 -0500

csiph-web