现在的位置: 首页 > 综合 > 正文

孤儿进程组

2013年04月08日 ⁄ 综合 ⁄ 共 921字 ⁄ 字号 评论关闭

为什么有"孤儿进程组"

刺猬@http://blog.csdn.net/littlehedgehog

 

 

学习最忌讳的是等把所有内容都自以为学到手后,才突然慌神地反问自己“学这个是干什么的?”“这个究竟有什么用”。如果学一门学问到最后都不知道有什么用那最好别忙学,先看看它究竟在实际中运用到那些地方。中国教育大部分时间都是在教学生如何解题,所以当高数学了一学年最后吭哧吭哧考了个优后,竟然还要问自己"这个... 高数学,我没看见有什么用阿?"

 

 

APUE对于孤儿进程组的起源语焉不详,我这里从GNU摘来一段,清楚地解释了为什么会提出孤儿进程组的概念:

 

When a controlling process terminates, its terminal becomes free and a new session can be established on it. (In fact, another user could log in on the terminal.) This could cause a problem if any processes from the old session are still trying to use that terminal.

To prevent problems, process groups that continue running even after the session leader has terminated are marked as orphaned process groups.

When a process group becomes an orphan, its processes are sent a SIGHUP signal. Ordinarily, this causes the processes to terminate. However, if a program ignores this signal or establishes a handler for it, it can continue running as in the orphan process group even after its controlling process terminates; but it still cannot access the terminal any more.

 

 

 

 

 

 

 

抱歉!评论已关闭.