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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:58:31+00:00 2026-06-12T13:58:31+00:00

Usually a java program is running with a single process called javaw.And when I

  • 0

Usually a java program is running with a single process called “javaw”.And when I run a single process I can only get max resource of one core(of multicores).
But when I run a multithread program in jvm, the number of cores it used is according to the number of threads which is beyond one process can do. So can anyone give me some information about how jvm deal with multithread program in multicore cpu machine ?

/**
* I run this program in my machine which has 8 core cpu
* and the jre is 1.6.0_24
* How does jvm use one process to use all the cpu resources?        
*/

public class MultiCoreUseTest implements Runnable{
@Override
public void run() {

    int i;
    while(true)
         i =1;
}

public static void main(String[] args) {

    //create 8 threads
            //8 threads the usage of cpu is 100%
            // if 4 threads the usage of cpu is 50%
    for(int i = 0; i<8; i++){
        new Thread(new MultiCoreUseTest()).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-12T13:58:33+00:00Added an answer on June 12, 2026 at 1:58 pm

    The threads of one process can be distributed across different CPUs and CPU cores, just as individual processes can. Just because an application has one process does not mean that its many threads are bound to one CPU/core.

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

Sidebar

Related Questions

I usually run this program via a command line like so: java Program <TestClass.java
A single threaded program running a loop of 500 million iterations takes usually about
Ok so I've just started learning java (I usually program in Objective-C). My first
I usually C++ applications. The only web-application development I've done is writing Java Applets.
when i am loading some data into my java program, i usually use FileInputStream.
Usually i start debug a java program by type jdb in terminal, then it
I have a Java program running on two computers that are both on the
I am running a Java Program in command prompt The normal course is after
My Java program uses GitHub's raw address to access a version file to get
I have a third party java program called kgsgtp.jar which need to communicate 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.