tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 44454] busy count reported in mod_jk inflated, causes incorrect balancing
Date Tue, 22 Jun 2010 11:26:13 GMT

--- Comment #22 from Sebb <> 2010-06-22 07:26:05 EDT ---
At the risk of stating the obvious:

32 bit reads and writes are guaranteed atomic by the JVM.

However, an arithmetic operation (e.g. increment) requires two operations: 
read and then write, and another thread can write the field between the two
atomic operations.

64 bit reads and writes are not even guaranteed atomic. This was to allow for
systems that did not have 64 bit operations, which therefore had to perform 2
off 32-bit operations. (Note: they probably are atomic on most modern systems,
depending on the alignment).

Adding volatile makes 64 bit reads and writes atomic, but does not protect
multiple operations such as increment.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message