Christopher Schultz wrote:
> Can someone explain why "unsynchronized data" + "threaded access" !=
> "non-threadsafe code"?
> 
> It doesn't take a genius to see that the accessCount variable there is
> not threadsafe. And since Tomcat ought to be implemented such that
> multiple threads can run successfully... WTF??!
> 
> I'm not sure what source of the bitter animosity towards synchronization
> is in this case. Synchronization isn't a dirty word, especially when it
> actually makes things work properly :(

The problem is adding the sync hammers performance to the tune of
about 50ms for every request (at least in my system - YMMV). The other
part of this is that accessCount is there to support a reasonably rare
use case where a single request can last longer than the session timeout.

Currently, I am in favour of adding the syncs but making the use of
accessCount (and hence the syncs) optional with the default set to not
use accessCount. Those that need this feature but don't want the
performance hit of syncs are then free to implement their own solution
within their application specific to their circumstances.

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to