grpc-go stream object thread safe for 1 reading and 1 writing goroutine?

24 views
Skip to first unread message

Michael Leonard

unread,
Sep 23, 2016, 12:14:00 PM9/23/16
to grpc.io
Hi

Simple quick question I hope: am I ok to read from the stream object in one goroutine and write to it in another without obtaining a mutex lock?

I've found this thread: https://groups.google.com/forum/#!topic/grpc-io/aI6L6M4fzQ0 that says I can't write from multiple goroutines at once (without a lock)... but I wanted to check whether I could write from one goroutine and read from another without needing a mutex lock?

I'm fairly new to go and grpc but hopefully this isn't too stupid a quesiton. It does seem like the route-guide example is doing this without a lock, but I just wanted to double check.

Thanks
Reply all
Reply to author
Forward
0 new messages