Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Which method would not effect ?  RSS feed

 
Wasim Ahmed
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Folks, Which method would not effect the excution of the current thread if applied? sleep(), run(), wait(), notify/notifyall(), exiting from the Synchronized code/method.
 
deepak1
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Wasim Ahmed:
Folks, Which method would not effect the excution of the current thread if applied? sleep(), run(), wait(), notify/notifyall(), exiting from the Synchronized code/method.

Hi
i think answer is "none"
cauz it says "exiting from the Synchronized code/method"
As i think it means that thread will not execute any code after calling above functions but it will, wait() and sleep() will cause it to be in waiting state only.It will start execution (not guarantee since platform dependent) whenever it is in running state.
I may be wrong:-)
deepak
[This message has been edited by deepak1 (edited February 02, 2001).]
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak
Welcome to Javaranch. We have to follow some rules pertaining to names (or User Name) here at Javaranch.

Please refer to the Official policy on registered names at this link here

In the simplest of terms you will have to create a new User ID discarding deepak1 as soon as possible.

[This message has been edited by Rahul Mahindrakar (edited February 02, 2001).]
 
Jerry Pulley
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wasim,
Of the list of things you cited, only notify/notifyAll doesn't directly affect the execution of the current thread. These methods move another thread from the wait set of the current thread's monitor object.
Jerry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!