Some initial work towards cutting down the number of fork calls we do

This commit is contained in:
ridiculousfish
2012-03-06 15:12:37 -08:00
parent 9ee4e4e05c
commit 36fe1e4a46
5 changed files with 21 additions and 3 deletions

View File

@@ -304,6 +304,8 @@ int setup_child_process( job_t *j, process_t *p )
}
int g_fork_count = 0;
/**
This function is a wrapper around fork. If the fork calls fails
with EAGAIN, it is retried FORK_LAPS times, with a very slight
@@ -323,6 +325,8 @@ pid_t execute_fork(bool wait_for_threads_to_die)
struct timespec pollint;
int i;
g_fork_count++;
for( i=0; i<FORK_LAPS; i++ )
{
pid = fork();