Java Programming - Threads - Discussion

Thomas said: (Feb 4, 2011)  
I think this question and answer will confuse lerners.

My opinion is first: when an other thread with higher priority becomes runnable the vm might stop the executing of the currently running thread.

Second: the stop method is marked as deprecated so no question should base on it.

Stinger said: (Mar 17, 2011)  
stop method is deprecated and considered dangerous to use.

Ainul Habib said: (Jul 7, 2011)  
Hi !
Deprecated methods should not be in practice test, because in later version the method itself can be removed. 'stop' method in this case should never be used to stop any thread, in-fact it should be handled differently

F J said: (Aug 10, 2011)  
#2 is not true on a system with an multiprocessor machine. When a thread of higher priority becomes runnable, it will start executing, but that does not mean the current thread will stop.

Kalman said: (Nov 17, 2015)  
I'm sure that stopping a thread and putting it into the ready state in favor of a higher priority thread are completely different things.

Groumpf said: (Dec 4, 2015)  
What "a currently executing thread stop" means?

For me, when no instruction of the runnable will ever be executed.

But when a context switch comes, the thread is paused, not stopped.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.