• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Xtrann's Fun loving Journing
博客园    首页    新随笔    联系   管理    订阅  订阅
2009年10月26日
深入浅出Java多线程(2)-Swing中的EDT(事件分发线程)
摘要: 看到了吧,我们写的那个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)
invokeLater and InvokeAndWait
摘要: 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
摘要: volatile: ['vɔlətail] adj. 反复无常的, 挥发性的, 稍纵即逝的, 脾气火爆的 n. 挥发性物质volatile ---- 字面意思是易挥发的。 实际的意义,简单来说,用volatile确定义的一个变量与普通变量不同之处在于,在多线程的环境下,每个独立的线程都有自己的一块内存空间,为了提高速度,JAVA的线程会把共有的变量映射到自己的内存空间(共有的变量就是可以为多... 阅读全文
posted @ 2009-10-26 08:40 kamome_s 阅读(257) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3