what is ememcached?ememcached is an embed-memcached project if you want a memcached work with a local process, without any net communication to save some performance about socket, memcached string command process, embed-memcached is your best choice! how toview the test.c file, you will know how to use view config.h to config something yourself like "MAX_MEM_SIZE" or "USE_THREADS" if you use "USE_THREADS" configuration(default), ememcached will init all threak mutex, and you do not need setup any thread locks, when you use multi-threads program if you want to run a test first run Make command to complete the project if you want to build ememcached with your big project please edit the Makefile file interfaceint emem_init(); run first at all return: 0 int emem_set(char key, size_t nkey, int flags, time_t exptime, int vlen, char buf, int comm); key: store key nkey: key lengh flags: always 1 exptime: expired time vlen: store data length buf: store value comm: store command like "NREAD_ADD" or "NREAD_SET" return: fault < 0, sucess > 0 void emem_get(char key, size_t nkey); key: store key nkey: key length return: the data stored in memory, NULL fault void emem_del(char key, size_t nkey, time_t exptime); key: store key nkey: key length exptime: always 0 return: void
|