pdflush内核线程池及其中隐含的竞争(7)
另外在sigaction的手册页中可以详细的看到关于忽略SIGCHLD的后果: POSIX.1-1990 disallowed setting the action for SIGCHLD to SIG_IGN. POSIX.1-2001 allows this possibility, so that i
另外在sigaction的手册页中可以详细的看到关于忽略SIGCHLD的“后果”:
POSIX.1-1990 disallowed setting the action for SIGCHLD to SIG_IGN. POSIX.1-2001 allows this possibility, so that ignoring SIGCHLD can be used to prevent the creation of zombies (see wait(2)). Never- theless, the historical BSD and System V behaviours for ignoring SIGCHLD differ, so that the only completely portable method of ensuring that terminated children do not become zombies is to catch the SIGCHLD signal and perform a wait(2) or similar. |
无疑Linux内核是符合较新的POSIX标准的,这也给我们提供了一个避免产生僵尸进程的“简易”方法,不过要注意:这种手法是不可以移植的。
请折回头来再次考虑函数__pdflush(),这次我们关注其间的竞争:
135 /* unlocked test is OK here */ 136 if (nr_pdflush_threads < MAX_PDFLUSH_THREADS) 137 start_one_pdflush_thread(); |
- 上一篇:Linux日志文件系统及性能分析
- 下一篇:linux学习日记五 磁盘与文件系统管理
收藏文章
精彩图集
精彩文章