tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
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
https://issues.apache.org/bugzilla/show_bug.cgi?id=44454

--- Comment #22 from Sebb <sebb@apache.org> 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: 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message