• Post Reply Bookmark Topic Watch Topic
  • New Topic

differnce between in Sleep and thread?

 
purushotham singam
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all,
can anyone explain me the difference between Sleep and thread.
 
Tony Docherty
Saloon Keeper
Posts: 3138
72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are not comparable things.
Sleep (I'm assuming you are refering to the sleep() method in the Thread class) causes the current thread to cease execution for the given time period.
Thread or more precisely instances of the Thread class are threads of execution in your program.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Sun Concurrency Tutorial is a good introduction to Threads. Sleep will likely show up in there, too. Let us know if it helps or raises more questions!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!