From: dahms AT ifk20 DOT mach DOT uni-karlsruhe DOT de Subject: cygwin b17.1 system() using inefficient fork() instead of true vfork() 20 Jan 1997 21:48:08 -0800 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <009AEAAE.FE52F660.7691.cygnus.gnu-win32@ifk20.mach.uni-karlsruhe.de> Original-To: gnu-win32 AT cygnus DOT com Original-CC: dahms AT ifk20 DOT mach DOT uni-karlsruhe DOT de Original-Sender: owner-gnu-win32 AT cygnus DOT com Hi, I have an application which might use between a few MB of data space for simple tests, but 200MB and more in production. Because the unix WS can't be upgraded beyond the current 128MB RAM, and so page trashes like hell, I ran it on a Pentium with 256MB RAM under NT using b17.1, which performs quite good so far. I'd prefer Linux of course, but the box will need to run MS binaries, too. This big app sometimes calls system(), which according to the b17.1 sources, calls fork() before exec'ing the shell. That means a lot of memory is copied by the CPU unnecessarily, because it's replaced by the rather small shell. I get an error message about a splitted heap and that I should change something in the registry, but I don't know the systemwide consequences. Perhaps I can figure this out browsing MSDN. It would be more efficient calling vfork() inside system(), but as of b17.1, even if changed, vfork() just calls fork(). For unix newbies: vfork() creates a child running in the same address space as the parent, so no copy is needed, but you have to be careful what to do. On some unixes vfork() is the same as fork(), too, but nowadays these have Copy-On-Write (mentioned in another thread, inspiring this). I still don't know enough about NT to implement COW and true vfork() myself... Bye, Heribert (dahms AT ifk20 DOT mach DOT uni-karlsruhe DOT de) - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".