aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Threads Question. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Threads Question." Watch "Threads Question." New topic
Author

Threads Question.

Siddhu
Ranch Hand

Joined: Oct 02, 1999
Posts: 31
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

Joined: Dec 14, 1998
Posts: 20636
    ∞

Where did you get this question?
Are you asking about how to stop the current thread or about stopping a different thread?


permaculture Wood Burning Stoves 2.0 - 4-DVD set
Siddhu
Ranch Hand

Joined: Oct 02, 1999
Posts: 31
How to stop a current thread from executing?
Siddhu
Ranch Hand

Joined: Oct 02, 1999
Posts: 31
And also
When can the thread stop?
not stop executing
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20636
    ∞

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

Joined: Nov 22, 2008
Posts: 18944
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Threads Question.