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

  • SEARCH
  • Home
  • 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 588069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:16:46+00:00 2026-05-13T15:16:46+00:00

I have some questions regarding threads: What is the maximum number of threads allowed

  • 0

I have some questions regarding threads:

  1. What is the maximum number of threads allowed for a process before it decreases the performance of the application?
  2. If there’s a limit, how can this be changed?
  3. Is there an ideal number of threads that should be running in a multi-threaded application? If it depends on what the application is doing, can you cite an example?
  4. What are the factors to consider that affects these performance/thread limit?
  • 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-05-13T15:16:47+00:00Added an answer on May 13, 2026 at 3:16 pm

    This is actually a hard set of questions to which there are no absolute answers, but the following should serve as decent approximations:

    1. It is a function of your application behavior and your runtime environment, and can only be deduced by experimentation. There is usually a threshold after which your performance actually degrades as you increase the number of threads.

    2. Usually, after you find your limits, you have to figure out how to redesign your application such that the cost-per-thread is not as high. (Note that for some domains, you can get better performance by redesigning your algorithm and reducing the number of threads.)

    3. There is no general “ideal” number of threads, but you can sometimes find the optimal number of threads for an application on a specific runtime environment. This is usually done by experimentation, and graphing the results of benchmarks while varying the following:

      • Number of threads.
      • Buffer sizes (if the data is not in RAM) incrementing at some reasonable value (e.g., block size, packet size, cache size, etc.)
      • Varying chunk sizes (if you can process the data incrementally).
      • Various tuning knobs for the OS or language runtime.
      • Pinning threads to CPUs to improve locality.
    4. There are many factors that affect thread limits, but the most common ones are:

      • Per-thread memory usage (the more memory each thread uses, the fewer threads you can spawn)
      • Context-switching cost (the more threads you use, the more CPU-time is spent switching).
      • Lock contention (if you rely on a lot of coarse grained locking, the increasing the number of threads simply increases the contention.)
      • The threading model of the OS (How does it manage the threads? What are the per-thread costs?)
      • The threading model of the language runtime. (Coroutines, green-threads, OS threads, sparks, etc.)
      • The hardware. (How many CPUs/cores? Is it hyperthreaded? Does the OS loadbalance the threads appropriately, etc.)
      • Etc. (there are many more, but the above are the most important ones.)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There have been some similar questions asked regarding Grid views, but none have been
I've read some documentation on how Adaboost works but have some questions regarding it.
I have couple questions regarding some C++ rules. Why am I able to call
Hi I have some questions regarding Looper.prepare() and AsyncTasks. In my app I have
I have a question regarding the threads that my application spawns during execution and
I have some doubts regarding concurrency of posix threads in multiprocessor machine. I have
I'm trying to implement BigInt and have read some threads and articles regarding it,
I have some questions regarding read-write locks in POSIX Pthreads on a *nix system,
Some questions regarding the Thread.yield() method. What I have understood is When we call,Thread.Yield(),
I have a question regarding some CSS that I'm sure has a simple solution,

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.