Subject: cygwin b17.1 system() using inefficient fork() instead of true vfork()
From: [email-masked]

20 Jan 1997 21:48:08 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked]
Original-CC: [email-masked]
Original-Sender: [email-masked]

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 ([email-masked])
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".