Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8335897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:48:50+00:00 2026-06-09T03:48:50+00:00

I have a multi-threaded application that runs in several different environments and I think

  • 0

I have a multi-threaded application that runs in several different environments and I think that sometimes the environment limits the total number of threads that can be run at the same time. In particular, I think one of the systems is only allowing a single thread to run so there is no benefit to the multi-threading. What’s an easy way to tell when this happens?

ExecutorService exec = Executors.newFixedThreadPool(4);
TestRunnable tr = new TestRunnable();
for ( int i = 0; i < 20; i++ ) {
  try {
     exec.execute(sr);
  } catch (Exception E) {
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:48:52+00:00Added an answer on June 9, 2026 at 3:48 am

    I have a multi-threaded application that runs in several different environments and I think that sometimes the environment limits the total number of threads that can be run at the same time.

    Yea, the environment does limit the number of threads that can actually run at the same time. Specifically:

    • The hardware cannot run more threads simultaneously than there are processors (or hyperthreads) available on the physical machine or virtual machine.
    • Various OS limits may prevent you using all available resources; e.g. ulimit and cgroup based limits.

    • If the system is busy, your JVM may be competing with other application processes.

    • There may be concurrency bottlenecks in your Java code; e.g. points where one thread’s locking of some data structure is frequently holding up other threads.

    However, the JVM itself is not going to artificially limit you.

    You can find out the notional number of available processors using the Runtime.availableProcessors method.


    Note: the number of “runnable” threads is NOT the same thing as the number of “running” threads; i.e. the number of threads that can be physically executing instructions at the same time. The number of “runnable” threads is the number of threads that could be scheduled for execution … if there were enough processors available.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multi-threaded application that calls a number of URL's from Parallel.ForEach loop.
OK, so I have a very large multi-threaded unmanaged c++ application (server) that runs
I have created a multi-threaded application that runs fine on every system except for
I have a multi-threaded Delphi 6 Pro application that I am currently working on
I have a multi-threaded application that is using pthreads. I have a mutex() lock
Lets say I have a multi-threaded application that needs to resize some image files.
I have a multi-threaded Java application that will output information about a message it
I am having a multi-threaded application that fetches different web pages. For this, I've
I have a multi-threaded application that I'm debugging inside the IDE (Visual Studio 2008,
I have a PHP based multi-threaded application that I'm try to get working with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.