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写道:
>
> 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?
>
> On Fri, Jan 13, 2017 at 12:48 AM <[email protected] <javascript:>> wrote:
>
>> 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.
>>
>> -- 
>> 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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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
>>  
>> <https://groups.google.com/d/msgid/grpc-io/016596ed-296e-412d-9296-d0004abe147a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/f1e20fd3-1a33-4ee9-b8c6-e7712bba6a27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to