
linux
文章平均质量分 72
leewon1988
这个作者很懒,什么都没留下…
展开
-
dup学习
#include #include #include #include #include #include #include #include using namespace std;using namespace std::chrono;int main(int argc,char* argv[]){ int fd,fd_dup; int index=0; mute原创 2013-08-19 22:52:43 · 727 阅读 · 0 评论 -
linux作业管理相关信号
SIGHUP: SIGHUP信号在如下情况下会发生: 1. 控制终端关闭,此时会发送SIGHUP给会发送给session首进程以及几个后台进程组; 2. session首进程退出,此时会发送给前端进程组的每一个进程; 3.如果进程组的首进程推出,该进程组成为孤儿进程组,并且进程组中有进程处于停止状态(如发送SIGSTOP或者SIGTSTP),则先发送原创 2013-09-16 20:28:33 · 737 阅读 · 0 评论 -
linux线程结束
Linux下线程有三种结束的方法:1. 线程函数执行完毕,线程正常结束;2. 线程调用pthread_exit(void* rval_ptr)3. 线程被取消(也就是其他线程调用pthread_cancel(pthread_t)这里主要总结一下线程调用pthread_exit和pthread_cancel结束的问题。一. 线程被取消:线程被取消,就是其他线程调用pthrea原创 2013-09-19 18:12:43 · 1718 阅读 · 0 评论 -
加油站问题
/*There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to it原创 2013-10-05 14:45:14 · 832 阅读 · 0 评论