I want to do a Java program with a thread with parameters y and n
y–> starts a threadn–> stop the threadyagain –> It will start processing from the previous state where I stopped the thread
Thanks all
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The recommended way of pausing a thread is to implement a variable for telling the thread to pause, and to implement “wait” and “resume” with functions lock() and notify().
More details here: http://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html
(look for: “What should I use instead of Thread.suspend and Thread.resume?”)