一切还是要从这里考试说起
cvoid InitServerLast(void) {
bioInit();
initThreadedIO();
set_jemalloc_bg_thread(server.jemalloc_bg_thread);
server.initial_memory_usage = zmalloc_used_memory();
}
进入这个函数
c char *exec_name = strrchr(argv[0], '/');
if (exec_name == NULL) exec_name = argv[0];
server.sentinel_mode = checkForSentinelMode(argc,argv, exec_name);
initServerConfig();
ACLInit(); /* The ACL subsystem must be initialized ASAP because the
basic networking code and client creation depends on it. */
moduleInitModulesSystem();
connTypeInitialize();
***********************************************************、
replicaof masterip masterhost
replicaof masterip masterhost
-replicaof masterip masterhost
前几天读了redis双链表的实现,一个标准的双链表,但是也实现了存储任意类型,用void*,真的是奇淫技巧,可能是我见识少,感觉也能实现内核链表那种感觉,今天看来记录一下。
首先是结构定义
c/* Node, List, and Iterator are the only data structures used currently. */
typedef struct listNode { //指针和数据耦合在一起,非侵入式
struct listNode *prev;
struct listNode *next;
void *value;
} listNode;