This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes stopping a thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "stopping a thread" Watch "stopping a thread" New topic
Author

stopping a thread

kesava chaitanya
Ranch Hand

Joined: Aug 15, 2001
Posts: 140
hi

1)in the API stop method was deprecated ;How will u stop a thread?.;
2)wat is deadlock?
anybody write a simple exmple for stopping a thread
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

This is the recommended way to make a stoppable thread:

"Deadlock" is when one thread has locked object 1, and is waiting to lock object 2, while a second thread has locked object 2, and is waiting to lock object 1. The two threads will wait forever; this is called deadlock.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: stopping a thread
 
Similar Threads
Servlet Running in Infinite loop
Interruptinh thread
Threads Question.
Not directly stopping the thread
Blocking??