• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Threads Question.

 
Siddhu
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • 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
 
paul wheaton
Trailboss
Pie
Posts: 21596
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
How to stop a current thread from executing?
 
Siddhu
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And also
When can the thread stop?
not stop executing
 
paul wheaton
Trailboss
Pie
Posts: 21596
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • 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.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic