You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsif-dev@ws.apache.org by "Bernd Eckenfels (JIRA)" <ws...@ws.apache.org> on 2009/01/22 10:21:59 UTC
[jira] Created: (WSIF-95) Lazy Initialisation has race condition
which leads to livelock
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.