From aa2e2135f7d04d526ef12c885d9b57712cc2b079 Mon Sep 17 00:00:00 2001 From: Eric Windisch Date: Sun, 4 Nov 2012 23:01:54 -0500 Subject: Use spawn_n when not capturing return value If not capturing the return value, spawn_n is more efficient. Change-Id: Ie6baa934e81e17e2d73f70766628d4bc97b7aa5e --- openstack/common/eventlet_backdoor.py | 6 +++--- openstack/common/loopingcall.py | 2 +- openstack/common/service.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'openstack') diff --git a/openstack/common/eventlet_backdoor.py b/openstack/common/eventlet_backdoor.py index a86d24c..242c371 100644 --- a/openstack/common/eventlet_backdoor.py +++ b/openstack/common/eventlet_backdoor.py @@ -73,6 +73,6 @@ def initialize_if_enabled(): pprint.pprint(val) sys.displayhook = displayhook - eventlet.spawn(eventlet.backdoor.backdoor_server, - eventlet.listen(('localhost', CONF.backdoor_port)), - locals=backdoor_locals) + eventlet.spawn_n(eventlet.backdoor.backdoor_server, + eventlet.listen(('localhost', CONF.backdoor_port)), + locals=backdoor_locals) diff --git a/openstack/common/loopingcall.py b/openstack/common/loopingcall.py index ede3dae..ab576d6 100644 --- a/openstack/common/loopingcall.py +++ b/openstack/common/loopingcall.py @@ -78,7 +78,7 @@ class LoopingCall(object): self.done = done - greenthread.spawn(_inner) + greenthread.spawn_n(_inner) return self.done def stop(self): diff --git a/openstack/common/service.py b/openstack/common/service.py index 5630035..2bf67e5 100644 --- a/openstack/common/service.py +++ b/openstack/common/service.py @@ -191,7 +191,7 @@ class ProcessLauncher(object): # Close write to ensure only parent has it open os.close(self.writepipe) # Create greenthread to watch for parent to close pipe - eventlet.spawn(self._pipe_watcher) + eventlet.spawn_n(self._pipe_watcher) # Reseed random number generator random.seed() -- cgit