ws-wsif-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernd Eckenfels (JIRA)" <wsif-...@ws.apache.org>
Subject [jira] Created: (WSIF-95) Lazy Initialisation has race condition which leads to livelock
Date Thu, 22 Jan 2009 09:21:59 GMT
Lazy Initialisation has race condition which leads to livelock
--------------------------------------------------------------

                 Key: WSIF-95
                 URL: https://issues.apache.org/jira/browse/WSIF-95
             Project: Axis-WSIF
          Issue Type: Bug
          Components: Basic Architecture
    Affects Versions: 2.0, 2.1
         Environment: Especially triggered with Java 6
            Reporter: Bernd Eckenfels


The WSIFUtil class does a lazy initialization of the HashMap containing java keywords in the
isJavaKeyword() method. Since this is unguarded with a lock on program startup a high concurrency
can lead to multiple threads entering the code for filling the hashtable. This leads unfortunatelly
to a 100% cpu consumption since put/get are executed concurrently in this case.

The easiest fix would be to move the filling of the map into a static initializer. The big
advntage of this is, you can remove the if (keywordMap == null) chec completely and it is
thread safe with no locking.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message