龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 操作系统 > LINUX系统 >

pdflush内核线程池及其中隐含的竞争(7)

时间:2014-06-01 02:11来源:网络整理 作者:网络 点击:
分享到:
另外在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();
 
精彩图集

赞助商链接