`
fenglingxuewqk
  • 浏览: 82053 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

SimpleDateFormat的线程安全问题

 
阅读更多

SimpleDateFormat有线程安全问题。

在多线程的环境下,不使用SimpleDateFormat,或者不使用成员变量/静态成员变量的SimpleDateFormat。

Date formats are not synchronized.
* It is recommended to create separate format instances for each thread.
* If multiple threads access a format concurrently, it must be synchronized

在Sun自己的网站上。在sun的bug database中, Sun Bug #6231579   Sun Bug #6178997 都可以印证这个问题。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics