answersLogoWhite

0


Best Answer

at the starting of the JVM it handels approx 7000 threads .........

User Avatar

Wiki User

17y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How many threads run at the start of JVM?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How to use threads simultaneously?

Threads are meant to be used simultaneously. If you have 3 threads, you can run them simultaneously by starting them together. Ex: t1.start(); t2.start(); t3.start(); Assuming the three threads t1, t2 and t3 are already created.


What is a daemon thread?

A daemon thread is often called a "service thread" or a "nonessential thread". The other kind of thread is often called a "user thread."The JVM will exit when all user threads have returned from their run methods. Once all of the user threads have returned, any active daemon threads will be forced to stop running.Let's look at an abstract example to see the difference... Pretend you have written a client-server GUI-based chat client. You'll typically have at least one thread sitting around and listening for input from the other program (the server will listen for input from the client and the client will listen for input from the server). These threads can be set as daemon threads, because you don't want the JVM to keep executing if those are the only threads left.Not let's look at the GUI for your programs. These will be run in a user thread, since you want to make sure that the JVM does not exit until the GUI thread finishes running (you will generally stop these threads from running when the user clicks to close the window).


Is it possible to run java program without JVM?

No. Java programs run in the Java Virtual Machine (JVM) - without it your computer won't know how to handle Java bytecode.


Is Java is platform dependent or independent?

Java is not machine dependent. High-level Java source code is compiled against the JVM which produces Java byte code, the lower-level native language of the JVM. At runtime, the JVM interprets the byte code to produce the required machine-dependent code. Every platform that supports Java has its own JVM, thus the same byte code can execute upon any supported platform. The translation from byte code to machine-dependent code is handled solely by the platform JVM.


Can the run method be called directly to start a thread?

No. If you want to start a new thread of execution, you need to call the start() method of the thread. Also, the run() is like any other java method and you can invoke it directly but if you do so, it would be called as part of the current programs thread and not as a new thread. When the start() method is invoked, the JVM creates a new thread and automatically calls the run() method and that is why a new thread gets started and not by calling run() directly.

Related questions

How to use threads simultaneously?

Threads are meant to be used simultaneously. If you have 3 threads, you can run them simultaneously by starting them together. Ex: t1.start(); t2.start(); t3.start(); Assuming the three threads t1, t2 and t3 are already created.


What is a daemon thread?

A daemon thread is often called a "service thread" or a "nonessential thread". The other kind of thread is often called a "user thread."The JVM will exit when all user threads have returned from their run methods. Once all of the user threads have returned, any active daemon threads will be forced to stop running.Let's look at an abstract example to see the difference... Pretend you have written a client-server GUI-based chat client. You'll typically have at least one thread sitting around and listening for input from the other program (the server will listen for input from the client and the client will listen for input from the server). These threads can be set as daemon threads, because you don't want the JVM to keep executing if those are the only threads left.Not let's look at the GUI for your programs. These will be run in a user thread, since you want to make sure that the JVM does not exit until the GUI thread finishes running (you will generally stop these threads from running when the user clicks to close the window).


Should all the devices have jvm to run java application?

There are relatively few devices that don't have a JVM implementation, but it is not true that all devices should have a JVM.


Is it possible to run java program without JVM?

No. Java programs run in the Java Virtual Machine (JVM) - without it your computer won't know how to handle Java bytecode.


How many threads can be run on a single CPU pipeline?

5


If JVM is available on Windows then can you run a program written in Unix?

Yes. One of the fundamental principles of Java is "write once, run anywhere." This means that Java source code can run on any platform for which a JVM exists, regardless of where the original code was developed.


What is meant by JVM in applets?

Answer: JVM is nothing but java virtual machine,it is a software used to convert the bytecode(highly optimizes set of instructions) to machine code. so, now applet is a small java program run by a web browser.thus now we can understand for what JVM is used or mean in applets.Answer: In other words, JVM (Java virtual machine) is simply the component used to run software written in the Java language.


Is Java is platform dependent or independent?

Java is not machine dependent. High-level Java source code is compiled against the JVM which produces Java byte code, the lower-level native language of the JVM. At runtime, the JVM interprets the byte code to produce the required machine-dependent code. Every platform that supports Java has its own JVM, thus the same byte code can execute upon any supported platform. The translation from byte code to machine-dependent code is handled solely by the platform JVM.


Can the run method be called directly to start a thread?

No. If you want to start a new thread of execution, you need to call the start() method of the thread. Also, the run() is like any other java method and you can invoke it directly but if you do so, it would be called as part of the current programs thread and not as a new thread. When the start() method is invoked, the JVM creates a new thread and automatically calls the run() method and that is why a new thread gets started and not by calling run() directly.


Is JVM same for UNIX and window operating system?

Logically, for all intents and purposes the functionality of the JVM is the same in Windows and other operating systems, including Linux, Unix (and variants), z/os, etc. A Java program utilizing the JVM will run the same way on all the different platforms.


How many bytes does a Java VM have?

A JVM, or Java Virtual Machine, creates the environment in which programs that run using Java bytecode are processed. It does not itself possess bytes or bytecode.


How start method call the run method?

I think you're referring to the Thread class, and how calling Thread.start() simply appears to call the Thread.run() method. What happens is that the start() method tells the Java Virtual Machine to actually create and run a new thread. If you manually call the run() method, then your Thread object will execute its code, but it will run like a normal method - that is to say it will not spawn a new thread in the JVM.