https://issues.apache.org/bugzilla/show_bug.cgi?id=49972

--- Comment #5 from Sergey Vorobyev <sergeyvorob...@google.com> 2010-09-22 
11:46:36 EDT ---
Also, there are problem with 64 bit variable currentDateGenerated

http://java.sun.com/docs/books/jls/third_edition/html/memory.html
quote:
For the purposes of the Java programming language memory model, a single write
to a non-volatile long or double value is treated as two separate writes: one
to each 32-bit half. This can result in a situation where a thread sees the
first 32 bits of a 64 bit value from one write, and the second 32 bits from
another write. Writes and reads of volatile long and double values are always
atomic. Writes to and reads of references are always atomic, regardless of
whether they are implemented as 32 or 64 bit values.

So in first (lock-free) check
if ((now - currentDateGenerated) > 1000)
We can read inconsistante state

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to