libmemcachedmemcached的C客户端
libmemcached是C客户端到memcached服 务器的接口库。具有低内存占用率、线程安全、并提供对memcached功能的全面支持。它还采用多种命令行工具,包括: memcat、memflush、memrm、memstat、memslap 。
示例代码:
const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com"; memcached_pool_st* pool= memcached_pool(config_string, strlen(config_string)); memcached_return_t rc; memcached_st *memc= memcached_pool_pop(pool, false, &rc); .... do work /* Release the memc_ptr that was pulled from the pool */ memcached_pool_push(pool, memc); /* Destroy the pool. */ memcached_pool_destroy(pool);
评论