complite ERROR

2009-06-29 Thread tong cao
When I chenge some codes from the example,I have had the following errors: My purpose is send data from socket. --- 3 #include google/protobuf/io/zero_copy_stream.h 4 #include

Re: ProtocolBuffer crash before program execution

2009-06-29 Thread rodrigob
I have uploaded the crash screenshot with Protobug 2.1.0 at http://files.getdropbox.com/u/185965/parking_planning/protobuf_crash_210.jpg as you can see the error is very similar. This problem is being a show stopper for us, any help will be greatly appreciated... Regards, rodrigob. On Jun 26,

Re: Thread-safe messages

2009-06-29 Thread Jes
I forgot to mention that we are generating C++ code in the project. Jes On 29 jun, 19:01, Jes damealpi...@hotmail.com wrote: Hi everybody, we are working on a distributed environment that uses PB, where different threads will access to the contents of messages that can be updated at any

Service Factory?

2009-06-29 Thread rthompson.dtisoft....@gmail.com
What can you do with a ServiceDescriptor? Is there a DynamicServiceFactory similar to the DynamicMessageFactory where you can instantiate a service when all you have is a ServiceDescriptor, or some other equivalent way of doing it? Thanks! --~--~-~--~~~---~--~~

Re: Thread-safe messages

2009-06-29 Thread Christopher Smith
I'd recommend using an atomic swap to do your updates. So you create your new version of the PB localy, and then swap it in to the memory location that is visible to all the other threads. The only real downside is you stress the heap more, and that is probably cheaper/simpler (particularly if

Re: Thread-safe messages

2009-06-29 Thread Kenton Varda
Simply adding a mutex lock in every accessor wouldn't really make them thread-safe. Consider: if (my_message.has_foo()) { DoSomething(my_message.foo()); } This is not thread-safe if my_message can be modified in a separate thread *even if* each accessor locked a mutex, because foo could

Re: ProtocolBuffer crash before program execution

2009-06-29 Thread Kenton Varda
Sorry, I don't see what the problem could be. Make sure that you are compiling libprotobuf and your project with the same C runtime version (e.g. debug vs. non-debug, DLL vs. static, single-threaded vs. multi-threaded). If that doesn't help, can you send me a minimal example program that

Re: Using CopyingOutputStreamAdaptor and CodedOutputStream

2009-06-29 Thread Kenton Varda
On Sun, Jun 28, 2009 at 7:30 AM, Alex Black a...@alexblack.ca wrote: Hi, I'm trying to use these to serialize messages to my own stream. I have a couple of questions: 1. If I use message.SerializeToCodedStream() do I still need to write the size of the message to the stream on my own

RE: Using CopyingOutputStreamAdaptor and CodedOutputStream

2009-06-29 Thread Alex Black
Error: libprotobuf FATAL ..\src\google\protobuf\io\zero_copy_stream_impl.cc:377] CHECK failed: buffer_used_ == buffer_size_: BackUp() can only be called after Next(). Stack trace: msvcr90d.dll!_NMSG_WRITE(int rterrnum=10) Line 198 C msvcr90d.dll!abort() Line 68 C

Re: Using CopyingOutputStreamAdaptor and CodedOutputStream

2009-06-29 Thread Kenton Varda
No, that doesn't make sense. I need to see the exact code, from the point where the CodedOutputStream is constructed until it is destroyed. On Mon, Jun 29, 2009 at 5:35 PM, Kenton Varda ken...@google.com wrote: Odd. By any chance, does this only happen when writing a zero-length message?