Can concurrent goroutines share use of a single stream object? (It seems not.)

How is concurrency handled on the server?

What are some best-practices and traps around concurrency in grpc-go?

What did you see instead?

Hardly any mention of concurrency, thread safety, pooling etc.

This slide (in a presentation by Sameer Ajmani) implies that client objects can be reused because there's no locking or use of pools yet the Search() function can be called concurrently when handling concurrent requests. But perhaps that code was simplified for the presentation.

This comment has been minimized.

I was just at GopherCon '17 and saw Alan Shreve's "grpc: From Tutorial to Production" talk along with a few hundred other developers. It was a very good talk with a nice structure and flow that covered the topic well.

Except for one thing... Here's a version of his slides. Notice that the server-side cache as no concurrency protection:

This comment has been minimized.

@timbunce You're not missing anything. I mentioned during the talk that the code was not safe for concurrent usage and that any real implementation would need synchronization. Concurrency safety was omitted from the slides/talk in the interest of 1) focusing on the code related to grpc-specific issues 2) keeping the code on the slides big enough to be readable