[
https://issues.apache.org/jira/browse/VELOCITY-750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794035#action_12794035
]
Jarkko Viinamäki commented on VELOCITY-750:
-------------------------------------------
If I'm not mistaken, code in RuntimeInstance class seems to have some sort of
broken "Double Checked Locking" implementation. See
http://jeremymanson.blogspot.com/2007/05/double-checked-locking-and-problem-with.html
Proper synchronization will introduce a performance penalty for all page
renderings.
> org.apache.velocity.runtime.RuntimeInstance initialization is not ThreadSafe
> ----------------------------------------------------------------------------
>
> Key: VELOCITY-750
> URL: https://issues.apache.org/jira/browse/VELOCITY-750
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.6.2, 1.6.x
> Environment: Vista, Java 1.6
> Reporter: Cenek Rauscher
> Fix For: 1.6.x
>
>
> Two threads call Velocity.evaluate() method.
> Call RuntimeInstance.parse() and requireInitialization() method.
> One thread trying make initialization, set "initializing" to true and the
> other thread does not wait until initialization is done and go on.
> At next line Parser parser = (Parser) parserPool.get() is
> NullPointerException thrown.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]