grpc and libmemcached

85 views
Skip to first unread message

zhang...@gmail.com

unread,
Jan 13, 2017, 3:48:47 AM1/13/17
to grpc.io
I'm using grpc(c++) and libmemcached.
for the thread safety of libmemcached, I need to connect to memcached in every server function and disconnect before the function returns.
is there any way to make the memcached connection thread level? that's I could reuse memcached connections of the same thread.

thanks.

Craig Tiller

unread,
Jan 13, 2017, 9:52:08 AM1/13/17
to zhang...@gmail.com, grpc.io
This sounds more like a memcached question than a gRPC question, however I guess you could use a thread local variable to track your memcached connection?

--
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+u...@googlegroups.com.
To post to this group, send email to grp...@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/016596ed-296e-412d-9296-d0004abe147a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

zhang...@gmail.com

unread,
Jan 13, 2017, 9:07:35 PM1/13/17
to grpc.io, zhang...@gmail.com
thanks for reply, but I really think this is a grpc question, in this case, it is memcached, but in general, it is how to hook grpc thread initialization & uninitialization, because other libraries may also require per thread initialization.
now, I'm trying the async mode and think it could resolve the issue.
but would like to know if there's a generic solution in sync mode.



在 2017年1月13日星期五 UTC+8下午10:52:08,Craig Tiller写道:
Reply all
Reply to author
Forward
0 new messages