You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Xie Xiaodong <xx...@gmail.com> on 2009/04/02 10:47:05 UTC

Some questions about the AccessLogValve

Hello, Dear All,
   I found that "Double-Checked Locking Pattern" are heavily used in
AccessLogValve to get rid of race condition. But as far as I know, this
pattern will not work in Java according to this article:
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html. I
think this part need to be revised to get rid of race condition for sure.

-- 
Sincerely yours and Best Regards,
Xie Xiaodong

Re: Some questions about the AccessLogValve

Posted by Xie Xiaodong <xx...@gmail.com>.
Hello, Mark, I am greatly with you. After I finish my proposal, I will check
carefully what is the best way to solve this problem.




2009/4/2 Mark Thomas <ma...@apache.org>

> Xie Xiaodong wrote:
> > Hello, Dear All,
> >    I found that "Double-Checked Locking Pattern" are heavily used in
> > AccessLogValve to get rid of race condition. But as far as I know, this
> > pattern will not work in Java according to this article:
> > http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html<http://www.cs.umd.edu/%7Epugh/java/memoryModel/DoubleCheckedLocking.html>.
> I
> > think this part need to be revised to get rid of race condition for sure.
>
> Good catch.
>
> Looks like we need some volatiles in there. The best thing to do would be:
> - create a bugzilla entry for this (do it against Tomcat 6)
> - fix the problems
> - attach a patch (in diff -u format) to the bugzilla issue
> - one of the committers will review your patch and apply if it is OK
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>


-- 
Sincerely yours and Best Regards,
Xie Xiaodong

Re: Some questions about the AccessLogValve

Posted by Mark Thomas <ma...@apache.org>.
Xie Xiaodong wrote:
> Hello, Dear All,
>    I found that "Double-Checked Locking Pattern" are heavily used in
> AccessLogValve to get rid of race condition. But as far as I know, this
> pattern will not work in Java according to this article:
> http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html. I
> think this part need to be revised to get rid of race condition for sure.

Good catch.

Looks like we need some volatiles in there. The best thing to do would be:
- create a bugzilla entry for this (do it against Tomcat 6)
- fix the problems
- attach a patch (in diff -u format) to the bugzilla issue
- one of the committers will review your patch and apply if it is OK

Mark

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