Yes, you can have 1 cq shared by multiple threads; that is no problem. CQ operations are all thread-safe so you don't need additional locks just to use the cq.
- Vijay On Thursday, May 25, 2017 at 12:56:01 AM UTC-7, Przemysław Sobala wrote: > > Hello > I'm building my service on the base of this example: > https://github.com/grpc/grpc/blob/master/examples/cpp/helloworld/greeter_async_server.cc > If I want to add more threads that process server communication can it be > done by: > // run rpc handlers pool > for (int i = 0; i < threadsNo; i++) { > thread t(HandleRpcs, service, cq); > t.detach(); > } > ? > > One CompletionQueue shared by multiple read/write threads > -- > regards > Przemysław Sobala > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/4c642126-55ec-4913-9b36-923cfd4a3373%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
