On 27/09/12 13:57, Michael Stahl wrote:
following numbers are from my Fedora 17 system, with the toy attachment
that spawns 100k shells running "true" (only one run each):
argh... stupid me forgot to attach it and even clicked the wrong button
on the thunderbird warning...
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
int main(void)
{
char * shell = getenv("SHELL");
printf("%s\n", shell);
for (int i = 0; i < 100000; ++i)
{
if (fork())
{
wait(0);
}
else
{
char *const argv[] = { shell, "-c", "true", 0 };
execv(shell, argv);
}
}
}
Context
- Re: SHELL=/bin/sh vs bash performance · Michael Stahl
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.