上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 60 下一页
摘要: 目录1 概念2 使用场景2.1 饿汉式单例模式2.2 懒汉式单例模式2.3 双重检查锁定(线程安全) 1 概念 单例模式(Singleton Pattern)是一种常见的设计模式,用于确保一个类只有一个实例,并提供一个全局访问点来获取该实例。在C++中,单例模式通常用于管理全局资源或提供全局配置。 阅读全文
posted @ 2024-02-04 17:14 morty-root 阅读(86) 评论(0) 推荐(0)
摘要: 目录 阅读全文
posted @ 2024-02-01 22:33 morty-root 阅读(52) 评论(0) 推荐(0)
摘要: 目录通信流程文件描述符 通信流程 文件描述符 阅读全文
posted @ 2024-01-31 17:57 morty-root 阅读(49) 评论(0) 推荐(0)
摘要: 目录函数简介低层实现逻辑 函数简介 /* Manipulate an epoll instance "epfd". Returns 0 in case of success, -1 in case of error ( the "errno" variable will contain the sp 阅读全文
posted @ 2024-01-30 18:32 morty-root 阅读(386) 评论(0) 推荐(0)
摘要: 目录函数简介低层实现逻辑epoll_create与epoll_create1函数的区别 函数简介 /* Creates an epoll instance. Returns an fd for the new instance. The "size" parameter is a hint spec 阅读全文
posted @ 2024-01-30 18:21 morty-root 阅读(521) 评论(0) 推荐(0)
摘要: 目录函数简介低层实现逻辑 函数简介 /* Wait for events on an epoll instance "epfd". Returns the number of triggered events returned in "events" buffer. Or -1 in case of 阅读全文
posted @ 2024-01-30 18:15 morty-root 阅读(3672) 评论(0) 推荐(0)
摘要: 原因:缺少libmysqlclient-dev, 安装:apt-get install libmysqlclient-dev 阅读全文
posted @ 2024-01-30 15:25 morty-root 阅读(65) 评论(0) 推荐(0)
摘要: VS Code中安装插件:Remote-WSL扩展、Remote Development扩展 安装检查:在左下角有一个远程状态的标记 这个标记可以看出vscode在远程还是本地工作。点击后可选择需要的操作。 阅读全文
posted @ 2024-01-30 09:08 morty-root 阅读(55) 评论(0) 推荐(0)
摘要: 目录定义events字段data字段 定义 epoll_event结构体一般用在epoll机制中,其定义如下: struct epoll_event { uint32_t events; /* Epoll events */ epoll_data_t data; /* User data varia 阅读全文
posted @ 2024-01-29 18:39 morty-root 阅读(534) 评论(0) 推荐(0)
摘要: epoll 是一种在 Linux 上可用的高性能 I/O 事件通知机制,用于处理大量并发连接。 以下是使用 epoll 进行网络编程的基本步骤: 1. 创建 epoll 实例:使用 epoll_create 函数创建一个 epoll 实例。 2. 添加监听的文件描述符:使用 epoll_ctl 函数 阅读全文
posted @ 2024-01-29 17:17 morty-root 阅读(435) 评论(0) 推荐(0)
上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 60 下一页