Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

suspend in Threads

 
pallavi utukuri
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following are recommended ways a Thread may be blocked?
1) sleep()
2) wait/notify
3) suspend
4) pause
Ans:1,2
suspend also causes the Thread to be blocked so should suspend not be seclected in this scenario as it is deprecated
 
Karel KoboojBot
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As it is deprecated, I assume that it is not a recommended way of blocking a thread because in future versions of Java the method may not be supported (very well) anymore.
 
pallavi utukuri
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ys it is not recommended but in exam is it an invalid option as it is not depricated
 
pallavi utukuri
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ys it is not recommended but in exam is it an invalid option as it is *depricated
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic