From kde-commits Thu Aug 31 22:10:03 2006 From: Dirk Mueller Date: Thu, 31 Aug 2006 22:10:03 +0000 To: kde-commits Subject: branches/work/icecream-make-it-cool/daemon Message-Id: <1157062203.177137.5331.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=115706232609708 SVN commit 579360 by mueller: don't assign jobs if we're currently busy. reduces impact on a machine due to job preloading. M +4 -3 main.cpp --- branches/work/icecream-make-it-cool/daemon/main.cpp #579359:579360 @@ -266,7 +266,7 @@ } }; -int dcc_new_pgrp(void) +static int set_new_pgrp(void) { /* If we're a session group leader, then we are not able to call * setpgid(). However, setsid will implicitly have put us into a new @@ -734,7 +734,8 @@ void Daemon::handle_old_request() { - while ( current_kids + clients.active_processes < max_kids ) { + while ( current_load < 1000 + && current_kids + clients.active_processes < max_kids ) { Client *client = clients.get_earliest_client(Client::LINKJOB); if ( client ) { @@ -1390,7 +1391,7 @@ /* Still create a new process group, even if not detached */ trace() << "not detaching\n"; - if ((ret = dcc_new_pgrp()) != 0) + if ((ret = set_new_pgrp()) != 0) return ret; /* Don't catch signals until we've detached or created a process group. */