- APUE复习一下……
- muduo的几篇文章…… http://blog.csdn.net/Solstice/article/details/5307710 基本准备照着这个写
- reactor https://segmentfault.com/a/1190000002715832
- http://www.kegel.com/c10k.html#1:1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set shell=/bin/bash | |
syntax on | |
if &term =~ '^\(xterm\|screen\)$' && $COLORTERM == 'gnome-terminal' | |
set t_Co=256 | |
endif | |
filetype on | |
filetype plugin on | |
set autoindent | |
set nolazyredraw | |
set number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <array> | |
#include <cassert> | |
using namespace std; | |
constexpr int f() | |
{ | |
return 42; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Class1 | |
{ | |
using Tag = Tag1; | |
}; | |
struct Class1B | |
{ | |
using Tag = Tag1; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <utility> | |
#include <initializer_list> | |
#include <iterator> | |
#include <cassert> | |
#include <climits> | |
#include <map> | |
using namespace std; |
对于一个Hadoop控制器,一个job控制器会把它分成m个规模类似的task,交给不同的物理节点(node)去执行,每个节点可以执行任意多(或不执行)task。总共有n个不同的物理节点。
现在需要一个策略,把这m个task,分给不同的节点,确定每个节点分配到多少个不同的task。这个过程叫做scheduling
这些task依赖的数据,存在某些node上。因此这些node,执行完一个task的时间就会比较短$C_{loc}$, 其它结点执行完的一个task时间$C_{rem}$就会更长(因为要把原来节点的数据复制过来)
基于上述原因,之前的调度算法(文献详见hadoop scheduling algorithms,其中除了BAR和SDN那篇之外都是综述),主要的目的有:
- 使得schedule的方案中,最后一个task执行完的时间最短(Minimum span problem, NP),于是就有了很多启发式的方法,例如BAR
- 使得平均完成时间最短
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstddef> | |
#include <cstring> | |
#include <cstdlib> | |
#include <thread> | |
#include <functional> | |
#include <queue> | |
#include <chrono> | |
#include <mutex> | |
#include <sstream> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdio> | |
#include <cstddef> | |
#include <csignal> | |
#include <cstdlib> | |
#include <unistd.h> | |
#include <sys/wait.h> | |
#include <string> | |
#include <vector> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile with -std=c++11 -pthread | |
#include <iostream> | |
#include <cstdio> | |
#include <cstddef> | |
#include <csignal> | |
#include <cstdlib> | |
#include <unistd.h> | |
#include <sys/wait.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile this with C++11: -std=c++11 | |
#include <utility> | |
#include <iostream> | |
#include <vector> | |
#include <tuple> | |
#include <numeric> | |
#include <functional> | |
using namespace std; |