Post a Job  |   Ask a Question?   |   Already registered? login or register
Rashmiranjan pratap
28/04/2015 12:29 PM

can anyone tell what happens internally when start() is called on thread object?

can anyone tell what happens internally when start() is called on thread object?
Spam    9 Comments

28/04/2015 12:31:51
That thread will go to ready state.

28/04/2015 12:35:26
The thread will go to ready state.

28/04/2015 12:41:29
when we call the start() method then the start() handover the run() to jvm .then jvm schedule the our run() execution

28/04/2015 13:15:38
whenever we call the start() method internally create a new thread ,which is used for the execution of run()

28/04/2015 13:17:59
the difference b/w start() and run() ,when we call start() a new thread will be created but in run() does not create thread ,it will execute just like a normal method

28/04/2015 13:34:37
Start() method will be called on the thread object. start() method will not create thread internally. when we call thread_obj.start () then that thread will go to the ready state. And When that run () method of that thread will be executed we cannot predict, It is based on the jvm design.

28/04/2015 18:48:13
when we call start() method on Thread then thread class start () will be called.thread class method do three activities actually FIRST ACTIVITY--->it register the thread with Thread scheduler to get priority that it will start based on threadscheduler given priority SECOND ACTIVITY--->And some other mandatory intializations will be happend which we can't predict correctly becoz start mehod is native i.e it is not implemented in java THIRD ACTIVITY--->as third activity run method will be called that is overriden by us in our thread calass I HOPE UR DOUBT IS CLEARED .I AM PROUD TO SAY that I AM SRIMAN's STUDENT

28/04/2015 19:47:56
mr.rashmirajan , when we are call the start() on thread class obj ,that all ready state to call the run() internally .based on the thread Priority ,jvm gives chance to call the run() method simultaneously. for examaple main() have thread Priority is 5 .if same thread Priority having jvm , call any one thread and swithes from one thread to onethers simultaneosly.

29/04/2015 03:59:23
as i know threads has designed to execute a task in interleaved manner by threads. here when ever you call a start() method it will go for ready state , meanwhile more threads also ready to start(),here thread scheduler will assign the priority for the threads , and those will go to run() state.

Languages :