[logback-dev] [JIRA] Updated: (LBCLASSIC-36) Synchronization of SimpleDateFormat object in DateConverter
Joern Huxhorn (JIRA)
noreply-jira at qos.ch
Wed Jun 17 13:21:10 CEST 2009
[ http://jira.qos.ch/browse/LBCLASSIC-36?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joern Huxhorn updated LBCLASSIC-36:
-----------------------------------
Attachment: DoubleCheckedLocking.patch
=== DateFormatting ===
java.runtime.version = 1.6.0_13-b03-211
java.vendor = Apple Inc.
java.version = 1.6.0_13
os.name = Mac OS X
os.version = 10.5.7
JODA: total of 52011401 operations, or 17337 operations per millisecond
SDF: total of 52664135 operations, or 17554 operations per millisecond
I've removed the double-checked locking from the example app.
http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html
How are you executing this app? I started it from within IDEA but I fear that this influences the outcome...
> Synchronization of SimpleDateFormat object in DateConverter
> -----------------------------------------------------------
>
> Key: LBCLASSIC-36
> URL: http://jira.qos.ch/browse/LBCLASSIC-36
> Project: logback-classic
> Issue Type: Bug
> Components: Other
> Affects Versions: unspecified
> Environment: Operating System: All
> Platform: All
> Reporter: Anders Hammar
> Assignee: Ceki Gulcu
> Attachments: DateConverter_patch.java, DateFormatPerfTest.java, dateformattest.zip, DoubleCheckedLocking.patch
>
>
> According to the API documentation of SimpleDateFormat, date formats are not synchronized and it is recommended to create separate format instances for each thread.
> However, a possibly simpler (mer efficient) solution would be to synchronize on the SimpleDateFormat object in the convert() method to prevent two threads to access it concurrently.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the logback-dev
mailing list