2026/3/24 7:00:17
网站建设
项目流程
wordpress搜站点网络中断,怎么建网站新手入门,wordpress 4.1分页,excel做的最好的网站详细内容#xff1a;日志模块#xff0c;使用宏实现流式输出#xff0c;支持同步日志与异步日志、自定义日志格式、日志级别、多日志分离等功能。线程模块#xff0c;封装pthread相关方法#xff0c;封装常用的锁包括#xff08;信号量#xff0c;读写锁#xff0c;自旋…详细内容日志模块使用宏实现流式输出支持同步日志与异步日志、自定义日志格式、日志级别、多日志分离等功能。线程模块封装pthread相关方法封装常用的锁包括信号量读写锁自旋锁等。IO协程调度模块基于ucontext_t实现非对称协程模型以线程池的方式实现多线程多协程协同调度同时依赖epoll实现了事件监听机制。定时器模块使用最小堆管理定时器配合IO协程调度模块可以完成基于协程的定时任务调度。hook模块将同步的系统调用封装成异步操作accept, recv, send等配合IO协程调度能够极大的提升服务器性能。Http模块封装了sokcet常用方法支持http协议解析客户端实现连接池发送请求服务器端实现servlet模式处理客户端请求支持单Reator多线程多Reator多线程模式的服务器。序列化模块序列化模块的底层存储是固定大小的块以链表形式组织。每次写入数据时将数据写入到链表最后一个块中如果最后一个块不足以容纳数据则分配一个新的块并添加到链表结尾再写入数据。ByteArray会记录当前的操作位置每次写入数据时该操作位置按写入大小往后偏移如果要读取数据则必须调用setPosition重新设置当前的操作位置。这样有个好处不用一开始就开一个很大的空间去存储数据。1. 主要功能支持序列化固定长度的有符号/无符号8位、16位、32位、64位整数支持序列化不固定长度的有符号/无符号32位、64位整数使用zigzag算法进行压缩支持序列化float、double类型支持序列化string和lengthstring的格式支持将序列化内容输出到文件支持大小端转换2. 功能演示代码语言javascriptAI代码解释std::vectorint32_t res; johnsonli::ByteArray::ptr ba(new johnsonli::ByteArray(base_len)); for(int i 0; ilen; i) { res.push_back(rand()); } for(auto it : res) { ba-writeFint32(it); } ba-setPosition(0); // 读之前偏移量要设置为0 for(auto it : res) { int32_t val ba-readFint32(); DO_ASSERT(it val); } DO_ASSERT(ba-getReadSize() 0); LOG_INFO(g_logger) writeFint32/readFint32 (int32_t) len len base_len base_len size ba-getSize();3. 模块介绍3.1 ByteArray序列化类。封装一个内存块使用链表将内存块连接实现动态扩容代码语言javascriptAI代码解释struct Node { Node(size_t s); //构造指定大小的内存块 Node(); ~Node(); char* ptr; //内存块地址指针 Node* next; //下一个内存块地址 size_t size; //内存块大小 };主要支持以下方法代码语言javascriptAI代码解释void writeFint8 (int8_t value); // 写入固定长度int8_t类型的数据 void writeFuint8 (uint8_t value); // 写入固定长度uint8_t类型的数据 // ... 16、32、64字节 void writeInt32 (int32_t value); // 压缩写入int32_t void writeUint32 (uint32_t value); // 压缩写入uint32_t // 64字节 void writeFloat (float value); void writeDouble(float value); void writeStringF16(const std::string value); // 写入std::string类型的数据,用uint16_t作为长度类型 void writeStringWithoutLength(const std::string value); // 不写长度 // ... void readFint8 (int8_t value); // 读取固定长度int8_t类型的数据 void readFuint8 (uint8_t value); // 读取固定长度uint8_t类型的数据 // ... 16、32、64字节 void readInt32 (int32_t value); // 读取压缩的int32_t void readUint32 (uint32_t value); // 读取压缩的uint32_t // 64字节 ...www.dongchedi.com/article/7597217223819772478www.dongchedi.com/article/7597215233471889944www.dongchedi.com/article/7597216873696526910www.dongchedi.com/article/7597217143041737241www.dongchedi.com/article/7597214870441935385www.dongchedi.com/article/7597214599947043353www.dongchedi.com/article/7597214580846477886www.dongchedi.com/article/7597216071082738201www.dongchedi.com/article/7597214433031078424www.dongchedi.com/article/7597214537498362392www.dongchedi.com/article/7597215399566361150www.dongchedi.com/article/7597215658752868888www.dongchedi.com/article/7597215102077141528www.dongchedi.com/article/7597214696924004889www.dongchedi.com/article/7597213042329895448www.dongchedi.com/article/7597215125493400126www.dongchedi.com/article/7597212587801018905www.dongchedi.com/article/7597214580846215742www.dongchedi.com/article/7597214267869692440www.dongchedi.com/article/7597213056480969278www.dongchedi.com/article/7597212812516639257www.dongchedi.com/article/7597212812516868633www.dongchedi.com/article/7597213320844182041www.dongchedi.com/article/7597211160895046206www.dongchedi.com/article/7597211076186374681www.dongchedi.com/article/7597212587801477657www.dongchedi.com/article/7597210839670080062www.dongchedi.com/article/7597210276412899864www.dongchedi.com/article/7597211030086926872www.dongchedi.com/article/7597211160895078974www.dongchedi.com/article/7597209997126238744www.dongchedi.com/article/7597209064238039577www.dongchedi.com/article/7597211030087287320www.dongchedi.com/article/7597209862904480318www.dongchedi.com/article/7597209319725253145www.dongchedi.com/article/7597208525277987353www.dongchedi.com/article/7597208525278151193www.dongchedi.com/article/7597210268858958398www.dongchedi.com/article/7597209475426435609www.dongchedi.com/article/7597209772429476377www.dongchedi.com/article/7597201951176213017www.dongchedi.com/article/7597201687174562366www.dongchedi.com/article/7597199724889997849www.dongchedi.com/article/7597199550092657177www.dongchedi.com/article/7597200248943329816www.dongchedi.com/article/7597199001863701017www.dongchedi.com/article/7597198298541834777www.dongchedi.com/article/7597200591446000190www.dongchedi.com/article/7597199968348357145www.dongchedi.com/article/7597199312984162841www.dongchedi.com/article/7597199429019861566www.dongchedi.com/article/7597196791863902782www.dongchedi.com/article/7597197725960110616www.dongchedi.com/article/7597197533550920217www.dongchedi.com/article/7597196766895079960www.dongchedi.com/article/7597197878439756313www.dongchedi.com/article/7597196909912031768www.dongchedi.com/article/7597195764053492248www.dongchedi.com/article/7597196370181030424www.dongchedi.com/article/7597195961618121241www.dongchedi.com/article/7597195004385182232www.dongchedi.com/article/7597196281857442366www.dongchedi.com/article/7597195368090075673www.dongchedi.com/article/7597195809683505689www.dongchedi.com/article/7597194439940932158www.dongchedi.com/article/7597194164794933822www.dongchedi.com/article/7597194060553749016www.dongchedi.com/article/7597195414877995544www.dongchedi.com/article/7597194911112479256www.dongchedi.com/article/7597194219174068761www.dongchedi.com/article/7597192718418756120www.dongchedi.com/article/7597191743318065689www.dongchedi.com/article/7597194069471003161www.dongchedi.com/article/7597193401016500760www.dongchedi.com/article/7597192147254772286www.dongchedi.com/article/7597192394672505406www.dongchedi.com/article/7597190301329080894www.dongchedi.com/article/7597188998091833881www.dongchedi.com/article/7597190006675243582www.dongchedi.com/article/7597189866363372056