I want to have multiple async client threads (each thread may or may not 
communicate with a different server) that send requests asynchronously 
using a single global completion queue:

global cq:
CompletionQueue* cq = new CompletionQueue();

actual rpc call:
AsyncClientCall* call = new AsyncClientCall;
call->response_reader = stub_->AsyncRPC(&call->context, request, cq);

I also have multiple response collection threads, that wish to collect 
responses from this global cq using Next():
void* tag;
bool ok = false;
cq.Next(&tag, &ok);

I know that Next() is a thread safe operation. I want to find out if thread 
safety still exists between the client threads that are trying to send a 
request using the global cq, and the response collection threads that are 
listening on the same global cq.
If this design is not thread safe, what is the best way to implement this 
functionality without having to poll multiple completion queues?

Thanks!

Regards,
Akshitha

-- 
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/36ff0e1f-f739-4ae6-9152-924478e8c833%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to