Hi, if I define a memcached pool like this:
memcached_pool_st* pool=memcached_pool("--SERVER=ip:port",config_length);
can I pop memcached_st multiple times use this pool? like:
memcached_st *memc1 = memcached_pool_pop(pool,false,&rc);
memcached_st *memc2 = memcached_pool_pop(pool,false,&rc);
can anywhere I find the detailed explanation of these functions, including the
returen value and parameters?
thank you very much!
--- 11年7月30日,周六, Brian Aker <[email protected]> 写道:
发件人: Brian Aker <[email protected]>
主题: Re: Can anyone tell me the benifit of libmemcached pool?
收件人: [email protected]
日期: 2011年7月30日,周六,上午7:02
BTW it works out well for non-threaded applications as well, since it is a
pretty easy API to use for just caching the connection between page calls (i.e.
and application running in Apache)
On Jul 29, 2011, at 12:45 PM, Trond Norbye wrote:
> You would use a pool of libmemcached instances in your multithreaded
> application to avoid initiating, connect, disconnect and destroy each time
> one of the threads wants to send a request to the memcached cluster. Instead
> you can get an instance from the pool, use it, and put it back in the pool
> for other threads to use..
>
> Cheers
>
> Trond
>