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


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

Re: How to programatically limit the number of threads in a java

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: How to programatically limit the number of threads in a java
Date Tue, 12 May 2015 12:01:16 -0400
Organization A noiseless patient Spider
Lines 18
Message-ID <mit82h$8g6$1@dont-email.me> (permalink)
References <d2e186ee-1bab-4737-9462-9031b6e2839e@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Tue, 12 May 2015 16:00:17 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="858a9d65d95f4ea4d355bd116aa2cdbf"; logging-data="8710"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rCSXUyByM5vuK1Vr1AStQ"
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
In-Reply-To <d2e186ee-1bab-4737-9462-9031b6e2839e@googlegroups.com>
Cancel-Lock sha1:dKiZdLTAAimPMHBaI1xQ4nQzsuw=
Xref csiph.com comp.lang.java.programmer:31681

Show key headers only | View raw


On 5/12/2015 11:49 AM, Ajay Paul wrote:
> How to programatically limit the number of threads in a java. I know the settings in different application servers such as websphere to do that, but how do we do it programatically.

     By starting the number of threads you want, no more and no less.

     That's not a perfect answer, because it controls only the number
of threads *you* start (or allow to finish, or don't start at all).
If classes not under your direct control start their own threads, or
if the JVM itself starts threads for its own purposes, they are pretty
much immune to your influence except insofar as they offer a means to
provide hints and limits.

     Do you want to limit the total number of threads running in the
JVM?  Why?  What are you trying to accomplish?

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

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


Thread

How to programatically limit the number of threads in a java Ajay Paul <ajaykpaul@gmail.com> - 2015-05-12 08:49 -0700
  Re: How to programatically limit the number of threads in a java Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-05-12 12:01 -0400
  Re: How to programatically limit the number of threads in a java Marcel Mueller <news.5.maazl@spamgourmet.org> - 2015-05-12 21:19 +0200
    Re: How to programatically limit the number of threads in a java Joerg Meier <joergmmeier@arcor.de> - 2015-05-13 09:48 +0200
      Re: How to programatically limit the number of threads in a java Arne Vajhøj <arne@vajhoej.dk> - 2015-06-03 21:51 -0400
        Re: How to programatically limit the number of threads in a java dolnotmail@nomail.com (e) - 2015-06-15 03:33 +0000
          Re: How to programatically limit the number of threads in a java Robert Klemme <shortcutter@googlemail.com> - 2015-06-15 08:23 +0200
    Re: How to programatically limit the number of threads in a java Arne Vajhøj <arne@vajhoej.dk> - 2015-06-03 21:50 -0400

csiph-web