Re: [grpc-io] Re: c++ multiple stubs

2019-11-12 Thread Christian Rivasseau
2 blocking calls on the same channel do not block each other, they will execute concurrently. The main reason to use asynchronous calls is when the caller themselves cannot block, for instance in a non blocking server (think of something similar to nodeJS). On Tue, Nov 12, 2019 at 10:29 PM

Re: [grpc-io] Re: c++ multiple stubs

2019-11-12 Thread martin . scholz
So you would say it’s ok to create for every call a new stub. But what about concurrency? Let’s say I create two stubs and they make a call at the same time on the same channel. Is one stub blocks the other one? So when you would use asynchronous calls? -- You received this message because

Re: [grpc-io] Re: c++ multiple stubs

2019-11-12 Thread 'Yang Gao' via grpc.io
Channels are relatively heavier weight and thus it could be a good idea to not create a lot of them (unless you hit some throughput bottleneck). Stubs are pretty cheap. Channels and stubs are all thread-safe. On Tue, Nov 12, 2019 at 1:22 PM wrote: > Sorry, i meant "Is it better to also create

[grpc-io] Re: c++ multiple stubs

2019-11-12 Thread martin . scholz
Sorry, i meant "Is it better to also create only one stub for all these calls or to create a stub for every function call..." Am Dienstag, 12. November 2019 22:18:15 UTC+1 schrieb martin...@versasec.com: > > After hours of reading on internet and not getting an answer i will ask > here. We are