• Post Reply Bookmark Topic Watch Topic
  • New Topic

starting a thread

 
ravindar tharanikumar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I understand from basic java material that start method of the thread
calls the run method which executes an instance of runnable. what i dont understand is
what happens after we call start()...what happens between the
time start method calling the run() method and the time run() starts executing.. what actions are performed on the runnable instance during this time? thanks in advance
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15713
73
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

The start() method of class Thread creates a new thread that starts running in parallel (i.e. at the same time) with other threads in the system. The run() method of the Runnable is the code that's being executed in the new thread.

How exactly start() creates a new thread depends on the underlying operating system. No special actions are done on the Runnable.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!