multithreading - Interactions between Java threads -


this question has answer here:

i have 2 classes (a & b) implements runnable.

both threads executed in way:

a = new a(); new thread(a).start();  b b = new b(); new thread(b).start(); 

i need stop/wait/resume thread inside thread b.

how it's possible?

actually, can't stop tread.as markspace commented, possible, should , in special cases

java thread primitive deprecation

why is thread.stopdeprecated?

because inherently unsafe. stopping thread causes unlock monitors has locked. (the monitors unlocked thethreaddeath exception propagates stack.) 


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -