Re: Making Velocity truly concurent

Jan Algermissen <[email protected]>
Newsgroups gmane.comp.jakarta.velocity.user
Message-ID <[email protected]>
On Sep 28, 2012, at 8:36 PM, Christopher Schultz wrote:

> Jan,
> 
> On 9/21/12 2:45 AM, Jan Algermissen wrote:
>> looking at the code yesterday, I saw that Velocity uses a number of
>> Serialized classes (e.g. the SerializedMap in ResourceCache).
>> 
>> I would like to replace all relevant classes to avoid serialization
>> completely.
> 
> Do you mean avoid all /synchronization/?

Yes, because I am in Java EE6 container and have a request scoped Velocity
context. In my understanding the only hot spot is the template cache and a
concurrent Map would solve that, correct?

> 
>> Are concurrent versions of these classes available already?
> 
> You mean something like java.util.concurrent?

Yes. I would basically replace the SynchronizedMap with a ConcurrentHashMap.
Before I do that, I was wondering whether anyone has done that already.

... and whether it would work, of couse :-)

Jan


> 
>> Is there a list of the classes I need to replace? (I am rather sure I
>> am not the first one aiming to to this..)
>> 
>> I am on 1.7 from the Maven repo.
> 
> -chris
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.