kindly expalin the following doubt on run method

can you explain how run method is called and who calls the run method.
Also can you explain that if a main method has one more thread then how the scheduling is done.How the priority is set for main and the other thread created. If the scheduling is based on platform then does that mean all the windows xp machine and all unix machine will have similar outputs.
I am not getting that does java also have some scheduling mechanism and how run method is called and scheduling is implemented in java.
How does the program know that scheduling has to be implemented now as the run method has been called.
May be the queston I have framed seems to be vague but please revert back incase you do not understand the question also.

Recommended Answers

All 3 Replies

Thread's start method calls run.

The scheduling is handled by the OS (AFAIK).

Thread's start method calls run.

The scheduling is handled by the OS (AFAIK).

can u kindly elaborate on AFAIK...
It is handled by OS that is right but does not java do anything to it....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.