Cygwin: sigproc: Allow more child processes per process
256 children per process is a bit tight in some scenarios. Fix this by revamping the `procs' array. Convert it to an extensible class child_procs and rename procs to chld_procs. Fix code throughout to use matching class methods rather than direct access. To allow a lot more child processes while trying to avoid allocations at DLL startup, maintain two arrays within class child_procs, one using a default size for 255 (i686) or 1023 (x86_64) children, the other, dynamically allocated on overflowing the first array, giving room for another 1023 (i686) or 4095 (x86_64) processes. On testing with a simple reproducer on a x86_64 machine with 4 Gigs RAM, a system memory overflow occured after forking about 1450 child processes, so this simple dynamic should suffice for a while. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@@ -39,8 +39,6 @@ enum child_status
|
||||
/* Change this value if you get a message indicating that it is out-of-sync. */
|
||||
#define CURR_CHILD_INFO_MAGIC 0xecc930b9U
|
||||
|
||||
#define NPROCS 256
|
||||
|
||||
#include "pinfo.h"
|
||||
struct cchildren
|
||||
{
|
||||
|
Reference in New Issue
Block a user