aboutsummaryrefslogtreecommitdiff
path: root/java/README.txt
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2014-03-21 17:08:30 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-03-21 17:08:31 +0000
commitddc98d6dd0800d180454b40ac9cc80f61cc53c21 (patch)
tree86ca269ba05f0c7b2faf133caa8a0a267b937c76 /java/README.txt
parent3a2109246f0223ad6f14bc986b46453eb51aaadb (diff)
parent5090f19ea7f56a5ceb27a8872a659479282e6871 (diff)
downloadprotobuf-ddc98d6dd0800d180454b40ac9cc80f61cc53c21.tar.gz
protobuf-ddc98d6dd0800d180454b40ac9cc80f61cc53c21.tar.bz2
protobuf-ddc98d6dd0800d180454b40ac9cc80f61cc53c21.zip
Merge "Don't reset cachedSize to 0 in getSerializedSize"
Diffstat (limited to 'java/README.txt')
-rw-r--r--java/README.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/java/README.txt b/java/README.txt
index 13865f6d..f958d147 100644
--- a/java/README.txt
+++ b/java/README.txt
@@ -437,6 +437,15 @@ and the runtime overhead. An overview of Nano features:
MessageNano.
- The 'bytes' type translates to the Java type byte[].
+The generated messages are not thread-safe for writes, but may be
+used simultaneously from multiple threads in a read-only manner.
+In other words, an appropriate synchronization mechanism (such as
+a ReadWriteLock) must be used to ensure that a message, its
+ancestors, and descendants are not accessed by any other threads
+while the message is being modified. Field reads, getter methods,
+toByteArray(...), writeTo(...), getCachedSize(), and
+getSerializedSize() are all considered read-only operations.
+
IMPORTANT: If you have fields with defaults and opt out of accessors
How fields with defaults are serialized has changed. Because we don't