Electric power conservation is extra critical than any one thing, it's the regular issue in the complete modern society. Now, the Countrywide Advancem...
分类:
其他好文 时间:
2014-10-17 15:13:22
阅读次数:
249
一 、Critical Sections(功能与Mutex相同,保证某一时刻只有一个线程能够访问共享资源,但是不是内核对象,所以访问速度比Mutex快,但是没有等待超时的功能,所以有可能导致死锁,使用要小心) 当多个线程访问一个独占性共享资源时,可以使用“临界区”对象。任一时刻只有一个线程可以拥有临...
分类:
编程语言 时间:
2014-10-14 17:42:28
阅读次数:
160
python检测linux下运行的进程#-*-coding:utf8-*-
importsubprocess
importsys
status_ok=0
status_critical=2
defc(d_name):
cmd=‘ps-ef|grep%s|grep-v"grep"‘%d_name
p=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE)
ifp.wait()==0:
val=p.stdout.read()
ifd_name..
分类:
编程语言 时间:
2014-10-13 21:12:07
阅读次数:
244
spinlock,mutex,semaphore,critical section的作用与区别...
分类:
其他好文 时间:
2014-10-13 12:29:39
阅读次数:
218
题目链接
题意: 给出一个无向图,按顺序输出桥
思路:求出所有的桥,然后按顺序输出即可
代码:
#include
#include
#include
#include
#include
#include
using namespace std;
const int MAXN = 10005;
struct Edge{
int to, nex...
分类:
其他好文 时间:
2014-10-13 11:20:50
阅读次数:
155
1 #include 2 #include 3 #include 4 //#include 5 #define T_MAX 100 6 int ticket; 7 CRITICAL_SECTION CriticalSection; 8 /* //售票线程 9 DWORD WINAPI Sale...
分类:
编程语言 时间:
2014-10-10 19:00:14
阅读次数:
297
一,what
关键路径法(Critical Path Method,CPM),又称为要径法,是计划项目活动中用到的一种算术方法。[1]对于有效的计划管理而言,关键路径是一个十分重要的工具。与计划评核术(Project Evaluation and ReviewTechniqu,PERT)非常类似。要径法所使用的估计作业时间是单一或确定的,而计划评核术则是使用机率性的估计作业时间。...
分类:
其他好文 时间:
2014-10-02 21:44:23
阅读次数:
291
#!/usr/bin/envpython
importsys
fromoptparseimportOptionParser
importstring
OK=0
WARNING=1
CRITICAL=2
UNKNOWN=3
unit={‘t‘:2**40,‘g‘:2**30,‘m‘:2**20,‘k‘:2**10,‘b‘:1}
defopt():
parser=OptionParser(usage="usage:%prog-wWARNING-cCRITICAL")
parser.add_option("..
分类:
移动开发 时间:
2014-09-27 19:10:10
阅读次数:
177
题目链接
题意:一个栈中只能放入U和L,问存在连续3个以上U(危险组合)的个数为几个
思路:用从的组合数-安全组合=危险组合。d[i]表示第i个位置以L结束的序列,所以就有d[i] = d[i - 1] + d[i - 2] + d[i - 3]。
代码:
#include
#include
#include
#include
#include
usin...
分类:
其他好文 时间:
2014-09-18 09:50:43
阅读次数:
220
临界段代码(critical sections),也叫临界区(critical region),是指那些必须完整连续运行,不可被打断的代码段。μC/OS-Ⅲ系统中存在大量临界段代码。采用两种方式对临界段代码进行保护:关闭中断、给调度器上锁。两种临界段代码保护功能均通过宏定义实现。 对于中断处理程.....
分类:
其他好文 时间:
2014-09-17 10:04:51
阅读次数:
214