Thursday, 25 August 2011

Java DateFormat and thread safety

Reminder: DateFormat is not thread safe.   It's a very easy trap to fall into.

See Javadocs:
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 externally.
And multiple other blogs:


No comments:

Post a Comment