• 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

Thread

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Under which conditions will a currently executing thread stop
a.When an interrupted exception occurs
b.When a thread of higher priority is ready (becomes Runnable)
c.When the thread creates a new thread
d.When the stop() method is called.
e.Wait for getID
is a a correct answer? looks like. : )
how about e?
Thanks
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well, let's see...
getID is a java.util.TimeZone method so i don't think that would
make a thread stop.
hmm... stop() is deprecated so i don't know much more about it other
than it's supposed to make a thread stop.
exceptions can occur and be handled without a thread stopping.
threads can create and start new threads w/o stopping themselves.
so i'd say b & d (tho i'm not sure about d)
 
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
we cannot be sure of the B option because in time slice system higher priority mean's nothing because all the thread's are given equal time.In preemptive scheduler a higher priority can definitely stop a thread of lower priority.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic