• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Which method would not effect ?

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic