Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

suspend() & resume() - problem  RSS feed

 
Sachin Ramesh Vir
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is use of suspend() and resume(). Even though it is deprecated, I just want to know what will be if it is used in the program. I refered the API, but it is confusing me. I also tried a pgm with suspend() and resume(), but nothing is happening. May be tha palce where I kept is matters?
Is it possible to give a small example program on which suspend() and resume() will useful.

Since resume() and suspend() are deprectaed, what are the new methods we are using instead of that?

I also want to know about stop() method. Whether it will stop the currently running thread permantely? Whether we can't reinstainte the thread which has been stopped using stop()?
 
Tom Billings
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically, if you don't have to maintain code containing suspend() resume() or stop() then don't then don't use it.

They are deprecated simply because they are unsafe, there is no silver bullet methods for this kind of functionality, therefore there are no replacement methods. Functionality of this kind would have to be implemented manually i.e. you will have to implement it yourself in a way that is safe for your application.

I suggest you read Paul Hyde's Java Thread Programming. It answers all of your questions in detail.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!