This is the mail archive of the
cygwin-developers@sources.redhat.com
mailing list for the Cygwin project.
A process can't have more than 63 child processes.
- To: cygwin-developers at cygwin dot com
- Subject: A process can't have more than 63 child processes.
- From: Kazuhiro Fujieda <fujieda at jaist dot ac dot jp>
- Date: 08 Feb 2001 17:58:47 +0900
I'm afraid the following includes only problem reports.
A process in Cygwin seems able to have up to 1023 children
because of the following code of `subproc.cc' and `pinfo.h'.
subproc.cc (proc_subproc)
247: case PROC_ADDCHILD:
248: if (nchildren >= PSIZE - 1)
249: system_printf ("nchildren too large %d", nchildren);
250: pchildren[nchildren] = vchild;
pinfo.h
21: #define PSIZE 1024
But a process can't have more than 63 child process in practice,
because WaitForMultipleObjects can't wait over 64 objects
according to MSDN.
subproc.cc (wait_subproc)
1234: DWORD rc = WaitForMultipleObjects (nchildren + 1, events, FALSE,
1235: proc_loop_wait);
In addition, fork doesn't return any error when a process create
too many children, because proc_subproc properly handle this
error as quoted above. I expect fork returns -1 and set errno to
EAGAIN.
____
| AIST Kazuhiro Fujieda <fujieda@jaist.ac.jp>
| HOKURIKU School of Information Science
o_/ 1990 Japan Advanced Institute of Science and Technology