• 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

Threads Question.

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can you stop thread.
1)stop running, if another Thread with higher Porperties is getting runnable.
2)using sleep() clause.
3)throwing interrupted exception.
4)if dead cannot be restarted
5)if the Thread starts another thread
6)if suspended cannot be restarted
7)if interrupted stop running
 
Trailboss
Posts: 23778
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where did you get this question?
Are you asking about how to stop the current thread or about stopping a different thread?

 
Siddhu
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to stop a current thread from executing?
 
Siddhu
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And also
When can the thread stop?
not stop executing
 
paul wheaton
Trailboss
Posts: 23778
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where did you get this question?
Was no answer provided?
What part do you not understand?
Most of the statements don't even make sense.
sleep() will definitely stop the current thread.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I guess currently Running thread May stop running if thread of Higher priority acquires a ready state.Again whether Higher priority thread enters Running state or NOT is depends on the Implementation.if it is time sliced approach We cant say higher priority thread will Run but if it is preemptive approach i guess higher priority thread will get a chance to Run thus stoping the current ThreaD.
well second option will obviously stops the Thread and puts into ready state.
I guess
Other statements Doesnot make sense
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic