commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henrib <hbies...@gmail.com>
Subject Re: [JEXL] 2.0 JSR-223 initial implementation added - what next?
Date Sat, 01 Aug 2009 16:21:41 GMT



sebb-2-2 wrote:
> 
> Thread-safety: is the interpreter thread-safe? 
> 

Both the JexlEngine & UnifiedJEXL are intended to be thread-safe & shared.
Besides usage of final fields in any applicable case, the (Expression,
UnifiedJEXL.Expression, MethodMap & al) shared caches are synchronized for
get/put and the expression node cache are volatile to ensure atomic
read/write ops.
The Interpreter is a "transient" that's never used outside of an eval and
will not be shared.
For peace of mind, the methods that manipulate flags for the
JexlEngine/UnifiedJEXL setLenient, setDebug & al could be made synchronized
or using volatile fields but it does not make much sense to call those after
real usage has began.

The only edge case is the JexlContext (at least the instance created by
JexlHelper) which is *not* threadsafe being based on a HashMap.

-- 
View this message in context: http://www.nabble.com/-JEXL--2.0-JSR-223-initial-implementation-added---what-next--tp24750307p24770490.html
Sent from the Commons - Dev mailing list archive at Nabble.com.


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


Mime
View raw message