tjumcw / 6.824 Goto Github PK
View Code? Open in Web Editor NEWMIT 6.824 distributed system C++Version
MIT 6.824 distributed system C++Version
针对Lab1中定时器效率较低的问题,使用epoll+时间轮的方法改进。相比于原来每启动一个定时器,就需要启动两个线程进行处理,改进后,整个master只需要一个epoll线程进行定时器的监听,且时间轮能以接近O(1)的时间复杂度,进行定时器的处理。PR已提交。
您好,大佬,就是在shardkv中,server中并没有与shardmaster相关联,也没有创建RPC server去bind join,query,move,leave,这是为什么呢?
这段代码怎么将term赋给index,这段代码是不是写错了:
Line 588 in 991d662
在master.cpp中的waitMapTask()
,作者的定时器方式是构造一个线程,让线程执行等待时间的任务:
pthread_create(&tid, NULL, waitTime, &op);
pthread_join(tid, &status); //join方式回收实现超时后解除阻塞
如果这样阻塞,和单线程的效率似乎是差不多的(甚至可能更差,涉及到线程上下文切换)?
因为在执行waitTime()
的时候,主线程就会一直阻塞。
我的想法是用epoll或者poll来通过定时事件触发(暂未实现),请问这样会不会更好呢?
这样直接判断为零就填充,是否有问题, 想象一种情况,一个server从集群启动开始就挂了,然后再经历几个term之后恢复,其中还没有日志记录,但当前任期leader给他发的log默认是按照自身的log最大值发送的,而server接收到之后却直接写入了(因为没有log记录),这里应该会出现不一致吧,感觉逻辑不应该这样。这里我觉得可以直接吧m_logs为空的情况归类到preindex = m_logs.size()的情况中,即删除这段代码即可
你好,我是今年找工作(24届),经验不是很足,我想学习一下您在简历上是怎么描述这个项目的可以吗?我在牛客联系您了,或者麻烦您加我的扣扣571965415。
当map执行某文件失败后,线程没有继续取出任务,还有就是使用currentIndex作为当前该进城任务是怎样保证其任务序号和当前线程任务对应上的呀?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.