On Thursday, May 17, 2018 at 2:31:37 PM UTC-7, jojy.v...@gmail.com wrote:

> If we have a polling thread that polls a CQ(calls next), it would mean
> that the polling thread would be doing the IO also right? I say this
> because if a client connection "writes" something, then that write will be
> picked up by the cq->next call of the polling thread (which internally
> looks for any work that needs to be done). Right?

Yes, when the polling threads have called `grpc::CompletionQueue::Next` or
`grpc::CompletionQueue::AsyncNext`, they are "borrowed" by gRPC to perform
I/O and computation. Additionally, the borrowed threads can be used to
perform work associated with all the completion queues, not just the one
they're polling. The tag will still only come out of the original queue,
even if the work was done by a thread polling a different completion queue.

You can sort of observe the borrowing behavior if you only ever poll using
`grpc::CompletionQueue::AsyncNext` and have a deadline of 0. gRPC will make
forward progress very slowly, if at all.

-- 
Christopher Warrington
Microsoft Corp.

-- 
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 grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
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/102ae821-a257-478f-b954-f3f8baeb8fec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to