New option --pin-process for the preforks

This commit is contained in:
Thomas Nagy 2015-01-20 23:13:31 +01:00
parent e044142c8e
commit 0c66df0fab
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
3 changed files with 9 additions and 6 deletions

View File

@ -174,7 +174,7 @@ if __name__ == '__main__':
create_server(conn, req)
else:
from waflib import Logs, Utils, Runner, Errors
from waflib import Logs, Utils, Runner, Errors, Options
def init_task_pool(self):
# lazy creation, and set a common pool for all task consumers
@ -357,7 +357,7 @@ else:
CONNS.append(conn)
def init_smp(self):
if not self.smp:
if not getattr(Options.options, 'smp', getattr(self, 'smp', None)):
return
if Utils.unversioned_sys_platform() in ('freebsd',):
pid = os.getpid()
@ -371,6 +371,7 @@ else:
def options(opt):
init_key(opt)
init_servers(opt, 40)
opt.add_option('--pin-process', action='store_true', dest='smp', default=False)
def build(bld):
if bld.cmd == 'clean':

View File

@ -31,7 +31,7 @@ def make_header(params, cookie=''):
return header
if 1:
from waflib import Logs, Utils, Runner, Errors
from waflib import Logs, Utils, Runner, Errors, Options
def init_task_pool(self):
# lazy creation, and set a common pool for all task consumers
@ -209,7 +209,7 @@ if 1:
CONNS.append(conn)
def init_smp(self):
if not self.smp:
if not getattr(Options.options, 'smp', getattr(self, 'smp', None)):
return
if Utils.unversioned_sys_platform() in ('freebsd',):
pid = os.getpid()
@ -221,6 +221,7 @@ if 1:
self.cmd_and_log(cmd, quiet=0)
def options(opt):
opt.add_option('--pin-process', action='store_true', dest='smp', default=False)
init_key(opt)
init_servers(opt, 40)

View File

@ -113,7 +113,7 @@ if 1:
if 1:
from waflib import Logs, Utils, Runner, Errors
from waflib import Logs, Utils, Runner, Errors, Options
def init_task_pool(self):
# lazy creation, and set a common pool for all task consumers
@ -262,7 +262,7 @@ if 1:
return ret
def init_smp(self):
if not self.smp:
if not getattr(Options.options, 'smp', getattr(self, 'smp', None)):
return
if Utils.unversioned_sys_platform() in ('freebsd',):
pid = os.getpid()
@ -275,6 +275,7 @@ if 1:
def options(opt):
# memory consumption might be at the lowest point while processing options
opt.add_option('--pin-process', action='store_true', dest='smp', default=False)
if Utils.is_win32 or os.sep != '/':
return
while len(CONNS) < 30: