孤儿进程和僵尸进程
正常的子进程fork其父进程后,二者建立父子关系。
当子进程终结时,它会通知父进程,并清空自己所占据的内存,并在kernel里留下自己的退出信息(exit code,如果顺利运行,为0;如果有错误或异常状况,为>0的整数)。在这个信息里,会解释该进程为什么退出。父进程在得知子进程终结时,有责任对该子进程使用wait系统调用。这个wait函数能从ke...
分类:
系统相关 时间:
2014-09-26 10:59:58
阅读次数:
269
Remmarguts' DateTime Limit:4000MSMemory Limit:65536KTotal Submissions:21396Accepted:5823Description"Good man never makes girls wait or breaks an appoi...
分类:
其他好文 时间:
2014-09-25 22:45:27
阅读次数:
258
1, //select and epoll_wait timeout. 'poll_thread_num' => 1, //reactor thread num 'worker_num' => 1, //reactor thread num ...
分类:
Web程序 时间:
2014-09-25 20:10:08
阅读次数:
268
shell是Unix/Linux中的重要工具,用来解析用户输入的命令。下面我们来实现一个简单的shell程序,来练习fork/exec/wait/exit的使用,顺便推荐一本书籍《Understanding Unix/Linux Programming - A Guide to Theory and...
分类:
其他好文 时间:
2014-09-24 21:50:47
阅读次数:
226
当一个线程直到收到另一个线程的通知才执行相关的动作,这时候,就可以考虑使用"事件等待句柄(Event Wait Handles)"。使用"事件等待句柄"主要用到3个类: AutoResetEvent, ManualResetEvent以及CountdownEvent(.NET 4.0以后才有)。本篇...
分类:
编程语言 时间:
2014-09-24 18:56:17
阅读次数:
256
第一种解释:
功能差不多,都用来进行线程控制,他们最大本质的区别是:sleep()不释放同步锁,wait()释放同步锁。
还有用法的上的不同是:sleep(milliseconds)可以用时间指定来使他自动醒过来,如果时间不到你只能调用interreput()来强行打断,wait()可以用notify()直接唤起。...
分类:
编程语言 时间:
2014-09-24 17:22:57
阅读次数:
190
学习IBM中国上的文章“系统调用跟我学”系列文章。文章地址为http://www.ibm.com/Search/?q=系统调用跟我学&v=16&en=utf&lang=zh&cc=cn&Search=搜索。 内容包括getpid, fork, exit和_exit,wait,waitpid和ex.....
分类:
系统相关 时间:
2014-09-24 15:41:36
阅读次数:
259
故障分析思路 查看等待事件,判断故障起因SQL>select * from (select sid,event,p1,p2,p3,p1text,WAIT_TIME,SECONDS_IN_WAIT from v$session_wait where wait_class# 6 order by wa....
分类:
其他好文 时间:
2014-09-23 19:02:55
阅读次数:
167
output
standard output
On Children's Day, the child got a toy from Delayyy as a present. However, the child is so naughty that he can't wait to destroy the toy.
The toy consists of n parts and
...
分类:
其他好文 时间:
2014-09-23 04:21:23
阅读次数:
220
pthread_cond_wait()用于阻塞当前线程,等待别的线程使用pthread_cond_signal()或pthread_cond_broadcast来唤醒它。pthread_cond_wait()必须与pthread_mutex 配套使用。pthread_cond_wait()函数一.....
分类:
其他好文 时间:
2014-09-23 01:37:13
阅读次数:
347