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


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

Re: thread pool with CachedThreadPool

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!fx24.iad.POSTED!not-for-mail
From Daniel Pitts <newsgroup.nospam@virtualinfinity.net>
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: thread pool with CachedThreadPool
References <liirm6$1vl6$1@ariadne.rz.tu-clausthal.de> <12vmb157ulwwb.1cmusyz7wuuyi$.dlg@40tude.net> <lij2aj$217t$1@ariadne.rz.tu-clausthal.de>
In-Reply-To <lij2aj$217t$1@ariadne.rz.tu-clausthal.de>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Lines 26
Message-ID <H2i3v.81309$aK5.58575@fx24.iad> (permalink)
X-Complaints-To abuse@newsrazor.net
NNTP-Posting-Date Tue, 15 Apr 2014 22:05:27 UTC
Date Tue, 15 Apr 2014 15:05:34 -0700
X-Received-Bytes 1803
X-Received-Body-CRC 221836448
Xref csiph.com comp.lang.java.programmer:28094

Show key headers only | View raw


On 4/15/14 3:40 AM, Philipp Kraus wrote:
> On 2014-04-15 10:02:56 +0000, Joerg Meier said:
>
>> On Tue, 15 Apr 2014 10:47:02 +0200, Philipp Kraus wrote:
>>
>> If you want a pauseable pool, you might want to look at the API
>> documentation for ThreadPoolExecutor, which has a simple example for
>> extending the class:
>>
>> <http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html>
>>
>>
>> Search for "For example, here is a subclass that adds a simple
>> pause/resume
>> feature:".
>
> Thanks imho the "shutdown" should be the "pause" option. I think it was
> a missunderstanding of the shutdown call

Why pause? All your tasks have completed, so all the "workers" that may 
still be running are "paused" automatically, awaiting a signal to start 
up again.

"Threads" with nothing to do take up very little CPU.  They may take up 
memory or other resources, but they can be made to do nothing until 
called for.

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


Thread

thread pool with CachedThreadPool Philipp Kraus <philipp.kraus@flashpixx.de> - 2014-04-15 10:47 +0200
  Re: thread pool with CachedThreadPool Joerg Meier <joergmmeier@arcor.de> - 2014-04-15 12:02 +0200
    Re: thread pool with CachedThreadPool Philipp Kraus <philipp.kraus@flashpixx.de> - 2014-04-15 12:40 +0200
      Re: thread pool with CachedThreadPool Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2014-04-15 15:05 -0700
        Re: thread pool with CachedThreadPool Robert Klemme <shortcutter@googlemail.com> - 2014-04-16 08:43 +0200
          Re: thread pool with CachedThreadPool Josip Almasi <joe@vrspace.org> - 2014-04-16 12:42 +0200
            Re: thread pool with CachedThreadPool Robert Klemme <shortcutter@googlemail.com> - 2014-04-16 17:55 +0200
              Re: thread pool with CachedThreadPool Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2014-04-16 22:11 -0700
                Re: thread pool with CachedThreadPool Josip Almasi <joe@vrspace.org> - 2014-04-17 12:12 +0200

csiph-web