Reactor模式是一种处理并发请求的事件驱动设计模式,常用于高性能网络编程。它基于I/O多路复用机制,使用同步非阻塞的方式处理客户端请求。下面我将详细介绍Reactor模式的结构和工作原理。
Reactor模式由以下几个角色构成:
python'''
Author: yowayimono
Date: 2023-11-18 16:11:04
LastEditors: yowayimono
LastEditTime: 2023-11-18 16:16:11
Description: nothing
'''
import sqlite3
import csv
一切还是要从这里考试说起
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();
***********************************************************、