쓰레드3 Thread 종료시키기. 이렇게 해도 되는 것인지 모르겠다. -_-public class RecvThread implements Runnable { public void run() { try { byte[] reqCode = new byte[1]; while (!Thread.currentThread().isInterrupted()) { is.read(reqCode); switch (reqCode[0]) { case Protocol.RESPONSE_LOGIN: loginHandler(); break; case Protocol.RESPONSE_SLOGIN: sLoginHandler(); break; case Protocol.RESPONSE_JOIN: joinHandler(); break; case Protocol.RESPONSE_D.. 2008. 2. 4. Stopping thread in Java 졸작을 하다가 네트워크 프로그래밍에서 쓰레드를 닫으려고 쓰레드의 stop()을 호출했는데, 이클립스에서 deprecated라는 경고가 떴다. 왜그런가 해서 뒤져봤더니 흠냐 -_- Java Thread Primitive Deprecation Why is Thread.stop deprecated? Because it is inherently unsafe. Stopping a thread causes it to unlock all the monitors that it has locked. (The monitors are unlocked as the ThreadDeath exception propagates up the stack.) If any of the objects previously protected .. 2008. 2. 4. Threads Compared with Processes (Wikipedia 원문 보기) Threads are distinguished from traditional multitasking operating system processes in that processes are typically independent, carry considerable state information, have separate address spaces, and interact only through system-provided inter-process communication mechanisms. Multiple threads, on the other hand, typically share the state information of a single process, and sh.. 2007. 9. 29. 이전 1 다음