tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: Problem with threads in stage Service (Tomcat 7.0.14)
Date Thu, 04 Aug 2011 14:40:15 GMT
On 02/08/2011 02:11, Christopher Schultz wrote:
>> > public HTMLEncoder() { mapChar2HTMLEntity= new HashMap(); int
>> > longueur = characters.length;
>> > 
>> > for (int i = 0; i < longueur; i++) mapChar2HTMLEntity.put(new
>> > Character(characters[i]), entities[i]); }
> So you have Character -> String (entity reference). Your Map is not
> synchronized, but it doesn't have to be: you are only calling get() on
> it so there shouldn't be any synchronization issues here.

The static 'mapChar2HTMLEntity' field is re-initialised each time a new
instance is created.

If a read event is occurring in another thread at the same time, what
will happen?


p


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message