摘要:
看到了吧,我们写的那个getFileLock 是由AWT-EventQueue-0 线程执行,看右下角调用关系, EventDispathThread 启动 Run方法, 然后pumpEvents 取事件,然后从EventQueue取到InvocationEvent 执行Dispath Dispath调用的就是我们在getFileLock写的run() 方法, JDK代码如下:Code highl... 阅读全文
posted @ 2009-10-26 11:48
kamome_s
阅读(663)
评论(0)
推荐(0)
摘要:
7.3 Using invokeLater( ) and invokeAndWait( )In the CharacterDisplayCanvas class, we were able to work aroundSwing's threading restrictions because all the callsthat manipulated Swing objects could go... 阅读全文
posted @ 2009-10-26 09:08
kamome_s
阅读(703)
评论(0)
推荐(0)
摘要:
volatile: ['vɔlətail] adj. 反复无常的, 挥发性的, 稍纵即逝的, 脾气火爆的 n. 挥发性物质volatile ---- 字面意思是易挥发的。 实际的意义,简单来说,用volatile确定义的一个变量与普通变量不同之处在于,在多线程的环境下,每个独立的线程都有自己的一块内存空间,为了提高速度,JAVA的线程会把共有的变量映射到自己的内存空间(共有的变量就是可以为多... 阅读全文
posted @ 2009-10-26 08:40
kamome_s
阅读(257)
评论(0)
推荐(0)
浙公网安备 33010602011771号