上一页 1 2 3 4 5 6 ··· 10 下一页
摘要: 2022.9.27 redis单线程与锁,构造分表的全局自增ID(所有表的id加索引,启动时候取个全局最大放到redis里,然后开始加锁自增,注意要加不可读的锁,单线程本来就是原子操作),雪花算法 mongodb原理,集群(所有的服务都可以读,一个主的可以写,主的挂了起一个当主的),写的时候有内存缓 阅读全文
posted @ 2022-09-27 09:24 摸鱼选手LLF 阅读(22) 评论(0) 推荐(0)
摘要: 链接:https://www.jianshu.com/p/5dcc088035dc 阅读全文
posted @ 2022-09-02 11:03 摸鱼选手LLF 阅读(12) 评论(0) 推荐(0)
摘要: int f[maxn][22]; int n,m; void ST_prework(){ for(int i=1;i<=n;i++) cin>>f[i][0]; int t=log2(n)+1; for(int j=1;j<t;j++){ for(int i=1;i<=n-(1<<j)+1;i++) 阅读全文
posted @ 2021-09-05 14:55 摸鱼选手LLF 阅读(21) 评论(0) 推荐(0)
摘要: typedef pair<int,int> pii; int u[]={0,0,1,-1},p[]={1,-1,0,0}; int vis[205][205]; int dfs() { for(int i=0;i<4;i++) { int xx=x+u[i],yy=y+p[i]; if(xx<0|| 阅读全文
posted @ 2021-07-15 11:56 摸鱼选手LLF 阅读(24) 评论(0) 推荐(0)
摘要: 复杂度n^2 ,没想出来怎么优化,‘*’赋值可以差分写,不过不减复杂度 #include <queue> #include <cstdlib> #include <cmath> #include <cstdio> #include <string> #include <cstring> #inclu 阅读全文
posted @ 2021-05-11 20:05 摸鱼选手LLF 阅读(63) 评论(0) 推荐(0)
摘要: 不会的点: √进程间同步,进程间通信方式 IO多路复用 epoll select poll √ 协程 死锁 进程和线程的死锁 √ 多线程多进程 √socket怎样建立进程间的通信 √Const关键字的用法 √右值引用 √编程实现:写一下shared_ptr这个类的实现,其中该有的数据成员和函数成员, 阅读全文
posted @ 2021-05-09 12:16 摸鱼选手LLF 阅读(75) 评论(0) 推荐(0)
摘要: select main() { int sock; FILE *fp; struct fd_set fds; struct timeval timeout={3,0}; //select等待3秒,3秒轮询,要非阻塞就置0 char buffer[256]={0}; //256字节的接收缓冲区 /* 阅读全文
posted @ 2021-05-08 11:42 摸鱼选手LLF 阅读(90) 评论(0) 推荐(0)
摘要: 服务器: #include "InitSock.h" #include #include using namespace std; CInitSock initSock; // 初始化Winsock库 int main() { // 创建套节字 SOCKET sListen = ::socket(A 阅读全文
posted @ 2021-05-07 10:38 摸鱼选手LLF 阅读(103) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; template <typename T> class Sharedptr { public: //空参数构造, 空指针 Sharedptr():count(0), ptr((T*) 0){} //构造函数 c 阅读全文
posted @ 2021-05-05 01:56 摸鱼选手LLF 阅读(173) 评论(0) 推荐(0)
摘要: #include<iostream> #include<bits/stdc++.h> using namespace std; class hip { public: int *a; int cnt; hip(){a=0,cnt=0;} hip(int arr[],int n) { cnt=n; a 阅读全文
posted @ 2021-05-03 13:45 摸鱼选手LLF 阅读(48) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 10 下一页