Mail Archives: cygwin-developers/1999/01/19/10:54:55

From: coreyg AT surfree DOT com (Geoff Corey)
Subject: Bumping PSIZE & NTTYS to 256 in shared.h
19 Jan 1999 10:54:55 -0800 :
Message-ID: <>
Mime-Version: 1.0
To: cygwin32-developers AT cygnus DOT com

Is there any reason why this shouldn't work?

I'm back porting software from UNIX to NT and I don't have a very large timeframe (thanks to the marketing department).   The code does I bunch of forks when connecting users (thanks to previous owners of the code).   I know forks are expensive under cygwin (not to mention in general), however if I bump this number up it solves my time crunch until I can move the software to a threading model.

The limiting factor for forking this many processes is memory.   My test program will try and fork 300 processes.   Watching the forked processes under the performance monitor shows that it will allocate about a 1 meg of memory for each process.    If you do not have enough memory then NT will hit the swap file.  Hit the swap file may cause a timeout in the fork routine, causing the fork to fail.

Here is exactly what I did.

Modified shared.h under winsup directory and changed 
#define PSIZE 128 to #define PSIZE 256
#define NTTYS 128 to #define NTTYS 128

Recompiled the cygwin1.dll and replaced the one found in B20.1

I used the following test program to see if it works
#include <stdio.h>
#include <process.h>
static int i;

main(int argc, char *argv[])
	int j;
		j = fork();
		printf("Forked %d\n",i);

Phone (770) 522-4718
Email coreyg AT surfree DOT com (HBOC mail is not setup yet!)
$14.95 Unlimited Internet Access,

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019