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 6180231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:48:39+00:00 2026-05-24T00:48:39+00:00

I posted this question asking why 100000 run () calls is faster compred to

  • 0

I posted this question asking why 100000 run() calls is faster compred to 100000 start() as i found out that despite multi threading, 100000 start would actually take longer than 10000 run calls because of the thread management.

Actually, i was trying to spawn 100000 threads to simulate a load on an EJB method i wish to test, and it seems not possible this way. Is there a way which i could achieve this? Or is it that i would need to have multiple machines in order to achieve that load.

Is it true that if i have a quad core pc, i should only spawn at most 4 threads at a time to prevent too heavy context switching because at any one time 4 threads would be run?

  • 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-24T00:48:40+00:00Added an answer on May 24, 2026 at 12:48 am

    If you have 4 cores which support hyper threading, you can only actually load 8 threads at once. You can start more threads than this, however only 8 can be active at any one time. This is a limitation of the hardware you are using.

    I very much doubt you need to run 10K or 100K threads to test any system. Most systems can be saturated with work with just one thread (or a very small number) and I suspect your EJB is no exception.

    You cannot test a method is thread safe via brute force testing. You can only determine this by reading the code.

    You might find this article interesting Java: What is the limit to the number of threads you can create?

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

Sidebar

Related Questions

I'm asking this question because I have gone through the tutorial posted here: Preventing
A few days ago, I posted this question and this question asking about how
I realize that this question is slightly server related and could be posted on
I've recently posted a question in this forum asking for any advice regarding missing
I have posted a question on here previously asking similar advise, but this project
I just posted this question: How to distribute my Java program so that it
I posted this question on Reddit Programming and did not get a single response.
I posted this question here on purpose, although - for my case - it
I posted this question on superuser a bit ago, but I haven't gotten an
I posted this question at ActiveState but got no reply from support or in

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.