Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

threads - start() & run()

 
Shweta
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the name of the method used to schedule a thread for execution and that for executing a thread?
init();
start();
run();
resume();
sleep();
feel it is start() and run() simultaneously.
 
Amit Tyagi
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You are right.
Its run() - for executing a therad. &
start() - for scheduling a thread.

Amit
 
Ajith Kallambella
Sheriff
Posts: 5782
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'Shweta',
PROPER NAMES ARE NOW REQUIRED!!
Read this post for more details.
Javaranch appreciates your cooperation to comply with the official naming policy.
Ajith
 
Chrisis
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can not execute a thread. Calling start will put it in runnable state but calling 'run' will just use that method in the current thread. You can think of the 'thready' code existing in 'start' only.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic