摘要:
保护性暂停(Guarded Suspension)模式是让一个线程等待另一个线程的结果。java中的join、Future、FutureTask均采用了该模式实现。 join() join()方法使得调用该方法的线程等待另一个线程的结束,比如下面的例子: public static void mai 阅读全文
摘要:
什么是ThreadLocal? This class provides thread-local variables. These variables differ from their normal counterparts in that each thread that accesses on 阅读全文
摘要:
程序计数器(PC Register) The Java Virtual Machine can support many threads of execution at once (JLS §17). Each Java Virtual Machine thread has its own pc ( 阅读全文