diff options
author | Max Cai <maxtroy@google.com> | 2014-04-14 14:57:53 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-04-14 14:57:54 +0000 |
commit | 56cba8eeae57043aa507c13b190ab16015872135 (patch) | |
tree | 1501b441be329d4d550cf2601f1a8c65537d3b43 /java/README.txt | |
parent | dc2ab875690f8061ba1a712872133120792e4746 (diff) | |
parent | 598087ef53c22ae3fd22f87d20d00bea2c16e949 (diff) | |
download | protobuf-56cba8eeae57043aa507c13b190ab16015872135.tar.gz protobuf-56cba8eeae57043aa507c13b190ab16015872135.tar.bz2 protobuf-56cba8eeae57043aa507c13b190ab16015872135.zip |
Merge "Don't reset cachedSize to 0 in getSerializedSize"
Diffstat (limited to 'java/README.txt')
-rw-r--r-- | java/README.txt | 9 |
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 |