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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:15:32+00:00 2026-06-01T03:15:32+00:00

I am just trying to avoid context switching as it introduces a lot of

  • 0

I am just trying to avoid context switching as it introduces a lot of latency. So If I am thinking that correctly, I want to have at maximum one thread per processor. If the processor supports virtual parallelism (hyper-threading I think it is the name!) then I can have the double number of threads.

Ex: 4 processors with hyperthreading = 8 threads max.

Of course the OS needs the processor as well, so I am maybe being naive here.

Anyways, knowing the number of threads the JVM creates on startup is a good start.

  • 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-01T03:15:33+00:00Added an answer on June 1, 2026 at 3:15 am

    The JVM only starts 1 user thread, also called the “Main” thread. There are other threads that are running behind the scenes such as garbage collectors, compilers, optimizers, finalizers, etc..

    A quick look at a thread dump for a nothing little app:

    public static void main(String[] args) throws Exception {
        Thread.sleep(100000);
    }
    

    Shows:

    "Low Memory Detector" daemon prio=5 tid=7f810c801000]
    "C2 CompilerThread1" daemon prio=9 tid=7f810c800000
    "C2 CompilerThread0" daemon prio=9 tid=7f8107037000
    "Signal Dispatcher" daemon prio=9 tid=7f8107036000
    "Surrogate Locker Thread (Concurrent GC)" daemon prio=5 tid=7f8107801000 
    "Finalizer" daemon prio=8 tid=7f810882a000 nid=0x1118cb000 
    "Reference Handler" daemon prio=10 tid=7f8108829000 nid=0x1117c8000 
    "main" prio=5 tid=7f8104801000 nid=0x109a52000 waiting on condition
    "VM Thread" prio=9 tid=7f8108824800 nid=0x1116c5000 runnable 
    "Gang worker#0 (Parallel GC Threads)" prio=9 tid=7f8104802800
    "Gang worker#1 (Parallel GC Threads)" prio=9 tid=7f8104803000 
    "Gang worker#2 (Parallel GC Threads)" prio=9 tid=7f8104803800 
    "Gang worker#3 (Parallel GC Threads)" prio=9 tid=7f8107800000 
    "Gang worker#4 (Parallel GC Threads)" prio=9 tid=7f8108800000 
    "Gang worker#5 (Parallel GC Threads)" prio=9 tid=7f8107000800
    "Gang worker#6 (Parallel GC Threads)" prio=9 tid=7f8107001000
    "Gang worker#7 (Parallel GC Threads)" prio=9 tid=7f8107002000 
    "Concurrent Mark-Sweep GC Thread" prio=9 tid=7f810701c000
    "Gang worker#0 (Parallel CMS Threads)" prio=9 tid=7f81090c3000
    "Gang worker#1 (Parallel CMS Threads)" prio=9 tid=7f810701b800
    "VM Periodic Task Thread" prio=10 tid=7f810c812800 
    "Exception Catcher Thread" prio=10 tid=7f8104801800
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started with Spring Web MVC. I'm trying to avoid file extenstions in
I want to have a function in a different module, that when called, has
Just trying to get my head around Generics by reading this enlightening article by
Just trying to get my irb sessions to actually list the current line of
Just trying to get up to speed with the SDK... So, I've created my
Just trying to get my head round Spring and figuring out how I wire
Just trying to get diff to work better for certain kinds of documents. With
just trying to test for equality in this piece of code, but getting a
Just trying to still get my head around IOC principles. Q1: Static Methods -
Just trying to establish whether prototype can do something like $$('#ID a:last').css('color','#111'); Any ideas

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.