On 21/10/2011 13:43, André Warnier wrote:
> Mark Thomas wrote:
> 
>> On 21/10/2011 11:42, André Warnier wrote:
>>> Allright, so how about a half-way house to start with ?
>>> Keep the list in some thread-safe table, indexed by session-id, and just
>>> scan the table.
>>> Updating the corresponding session entry at each request should be
>>> cheap.
>>>
>>> Of course in all this, my basic assumption is that currently, Tomcat
>>> keeps session information (including the expiration data) in some
>>> location which requires an I/O action to access.
>>
>> That assumption is incorrect. Which pretty much invalidates the rest of
>> the points below.
>>
>> Again, I *strongly* encourage you to look at the current implementation
>> before suggesting improvements.
>>
> 
> Mark,
> 
> with all due respect and really sincere appreciation for your and other
> Tomcat committers' work,
> 
> not all people who use Tomcat, and who sometimes try to be helpful in
> this forum, are Java developers, or even software developers in general.
> And such people also have other things which occupy their time for $
> reasons.
> 
> What I'm saying, is that what for you or other Tomcat committers may be
> a simple thing of 2 minutes to look up and understand, or which you do
> not even need to look up because you already know it for being immersed
> in it all day, is not necessarily so simple for others.
> 
> In a case like this one for instance, I would not even know where to
> start, about looking up the particular piece of code involved here. And
> when I would find it, which may take me a couple of hours, I am not sure
> that I would even understand that code.

You might be surprised at simple the code is.

http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java?view=annotate
(start at line 515)

http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardSession.java?view=annotate
(start at line 645)

For background, the sessions are in a ConcurrentHashMap, keyed by
session ID.

> This is not out of laziness.  It just so happens that 98% of my time is
> spent on other things than Java and Tomcat, and the remaining 2% I like
> to keep for reading the spirited correspondence on this list and trying
> to help on matters where a deep knowledge of Java and Tomcat code is not
> essential.
> 
> I apologise thus if you feel that I am wasting your time by making
> unwarranted suppositions or assumptions.  Even when making improper
> assumptions and suggestions, it is on the base of a desire to help.  I
> can of course stop this at any time, if you feel that my attempted
> contributions do more harm than good.

If anyone is going to suggest changes to improve the current
implementation then, yes, I think they need to know what the current
implementation is before they make those suggestions. It simply isn't
possible to state that "B is likely to perform better than A" without an
understanding of what A is.

In this case, you pretty much ended up describing exactly how Tomcat
currently manages sessions. Was this a waste of my time? If a few more
people now have a better understanding of how session management works
then no, I don't think it was a waste of my time.

Mark

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

Reply via email to