Re: [protobuf] Message thread safety in Java

2012-02-20 Thread Evan Jones
On Feb 20, 2012, at 16:20 , Christopher Smith wrote: > Message objects *don't* have mutators and are conceptually a copy of the > relevant builder object. Having attempted to refresh my knowledge of the Java Memory Model, I think there is a subtle difference between an object that has all final

Re: [protobuf] Message thread safety in Java

2012-02-20 Thread Christopher Smith
Message objects *don't* have mutators and are conceptually a copy of the relevant builder object. --Chris On Feb 20, 2012, at 10:22 AM, Tom Swirly wrote: > The documentation says it's immutable: > http://code.google.com/apis/protocolbuffers/docs/reference/java-generated.html#message > and th

Re: [protobuf] Message thread safety in Java

2012-02-20 Thread Tom Swirly
The documentation says it's immutable: http://code.google.com/apis/protocolbuffers/docs/reference/java-generated.html#messageand this code is heavily used in production, so you can bank on that. The only way I can see that this would be accomplished would be by returning a *copy* of the underlying

Re: [protobuf] Message thread safety in Java

2012-02-20 Thread Evan Jones
On Feb 20, 2012, at 8:25 , Frank Durden wrote: > I'm sorry if this is explained somewhere, I couldn't find an answer. > Are protobuf messages (in Java) thread safe for concurrent reads. I > guess they're immutable in the sense that you can't modify them after > they're built, but can a message obje

[protobuf] Message thread safety in Java

2012-02-20 Thread Frank Durden
Hi, I'm sorry if this is explained somewhere, I couldn't find an answer. Are protobuf messages (in Java) thread safe for concurrent reads. I guess they're immutable in the sense that you can't modify them after they're built, but can a message object content be read from different threads safely?