You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by sebb <se...@gmail.com> on 2010/03/30 18:30:38 UTC
Re: svn commit: r928798 - in /tomcat/trunk: java/org/apache/catalina/core/
java/org/apache/catalina/loader/ webapps/docs/config/
On 29/03/2010, markt@apache.org <ma...@apache.org> wrote:
> Author: markt
> Date: Mon Mar 29 15:01:14 2010
> New Revision: 928798
>
> URL: http://svn.apache.org/viewvc?rev=928798&view=rev
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48895
> Make clearing thread locals optional and disabled by default since it isn't thread-safe
However, the new boolean flag (clearReferencesThreadLocals) that
controls the process is not safely published between threads. It
should probably be volatile.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r928798 - in /tomcat/trunk: java/org/apache/catalina/core/
java/org/apache/catalina/loader/ webapps/docs/config/
Posted by sebb <se...@gmail.com>.
On 30/03/2010, Konstantin Kolinko <kn...@gmail.com> wrote:
> 2010/3/30 sebb <se...@gmail.com>:
>
> > On 29/03/2010, markt@apache.org <ma...@apache.org> wrote:
> >> Author: markt
> >> Date: Mon Mar 29 15:01:14 2010
> >> New Revision: 928798
> >>
> >> URL: http://svn.apache.org/viewvc?rev=928798&view=rev
> >> Log:
> >> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48895
> >> Make clearing thread locals optional and disabled by default since it isn't thread-safe
> >
> > However, the new boolean flag (clearReferencesThreadLocals) that
> > controls the process is not safely published between threads. It
> > should probably be volatile.
> >
>
>
> Startup is performed by a single thread, and it will set the value of
> this field.
OK, in that case not a problem.
However, it seems to me that this assumption should be documented in
the StandardContext class.
I think I saw a recent Bugzilla which suggested using multiple threads
to speed startup, in which case the assumption might become incorrect.
> According to the memory model all the threads started after that will
> see the assigned value.
Agreed; it's only a problem if two active threads access the same
mutable variable.
> I do not remember any of the "option value" fields in Tomcat being
> marked as volatile. All of them are usual fields.
>
> Best regards,
>
> Konstantin Kolinko
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r928798 - in /tomcat/trunk: java/org/apache/catalina/core/
java/org/apache/catalina/loader/ webapps/docs/config/
Posted by Konstantin Kolinko <kn...@gmail.com>.
2010/3/30 sebb <se...@gmail.com>:
> On 29/03/2010, markt@apache.org <ma...@apache.org> wrote:
>> Author: markt
>> Date: Mon Mar 29 15:01:14 2010
>> New Revision: 928798
>>
>> URL: http://svn.apache.org/viewvc?rev=928798&view=rev
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48895
>> Make clearing thread locals optional and disabled by default since it isn't thread-safe
>
> However, the new boolean flag (clearReferencesThreadLocals) that
> controls the process is not safely published between threads. It
> should probably be volatile.
>
Startup is performed by a single thread, and it will set the value of
this field.
According to the memory model all the threads started after that will
see the assigned value.
I do not remember any of the "option value" fields in Tomcat being
marked as volatile. All of them are usual fields.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org