You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2014/06/05 22:15:14 UTC

[Bug 56595] New: Review synchronization in DateUtil.isADateFormat(), replace with ThreadLocals?

https://issues.apache.org/bugzilla/show_bug.cgi?id=56595

            Bug ID: 56595
           Summary: Review synchronization in DateUtil.isADateFormat(),
                    replace with ThreadLocals?
           Product: POI
           Version: 3.11-dev
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: dev@poi.apache.org
          Reporter: dominik.stadler@gmx.at

Copied over comment after resolving Bug 56563 (likely a result of
caching/synchronization added in Bug 55611):

----
Note that every call to DateUtil.isCellDateFormatted(a-numeric-cell) ends up in
a call to DateUtil.isADateFormat() which itself also maintains a static cache
of the last result and synchronizes on DateUtil.class.

In my case for example, the issue with the formatString arises by a call to
DateUtil.isCellDateFormatted(cell), so I still get monitor locks upon each call
even though you use thread locals for the style formatString cache. 

Seems like it would be a good idea to use the same strategy and switch the
DateUtil.isADateFormat() cache to be ThreadLocal based rather than
synchronization based.
----

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 56595] Review synchronization in DateUtil.isADateFormat(), replace with ThreadLocals?

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56595

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
We now switched the cache in DateUtil.isADateFormat() to ThreadLocals as well
to not have another syncpoint here. 

Again only very little data is kept, so no memory bloat should happen because
of this.

See r1647296 for details.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org