• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

notify()?

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CAn notify() and notifyAll() possibly stop execution of a runing thread?
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Normally,I do not think these two methods will stop execution of a runing thread?

Originally posted by kevin goon:
CAn notify() and notifyAll() possibly stop execution of a runing thread?



------------------
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kevin,
My guess is that it can. If the thread thats gets placed into the ready state has a higher priority and the scheduler implemented honors it then the running thread could be preempted by the new one.
Manfred.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it depends on the operating system. If the OS has preemptive scheduling and if a higher priority thread becomes ready then the thread is moved from running to ready state.
-Vani
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Manfred Leonhardt:
Hi Kevin,
My guess is that it can. If the thread thats gets placed into the ready state has a higher priority and the scheduler implemented honors it then the running thread could be preempted by the new one.
Manfred.


Manfred,
IMHO, notify() (or notifyAll()) always comes in pair with wait(), right?
reply
    Bookmark Topic Watch Topic
  • New Topic