Commit bc66671c authored by U. Artie Eoff's avatar U. Artie Eoff Committed by Chad Versace

Remove ThreadPools

Remove ThreadPools from threads module since it is no longer
needed/used.  ConcurrentTestPool is now the only threadpool needed
to manage cpu-only tests.
Reviewed-by: default avatarChad Versace <chad.versace@intel.com>
parent 7b95d521
......@@ -56,41 +56,3 @@ class ConcurrentTestPool(Singleton):
def join(self):
self.pool.wait()
class ThreadPools(Singleton):
@synchronized_self
def init(self):
self.threadpools = dict() # {name : threadpool}
self.create("base", 1)
@synchronized_self
def lookup(self, name):
return self.threadpools.get(name, None)
@synchronized_self
def create(self, name, count = 2):
if self.lookup(name) is None:
self.threadpools[name] = ThreadPool(count)
else:
raise RuntimeWarning, "ThreadPool '%s' has already been created." % name
@synchronized_self
def put(self, callable_, args = None, kwds = None, name = "base"):
pool = self.lookup(name)
if pool is None:
raise RuntimeError, "ThreadPool '%s' does not exist." % name
pool.putRequest(
WorkRequest(
callable_, args = args, kwds = kwds
)
)
def joinAll(self):
pools = list(self.threadpools.itervalues())
try:
for pool in pools:
pool.wait()
except KeyboardInterrupt:
pools = list(self.threadpools.itervalues())
for pool in pools:
pool.dismissWorkers(len(pool.workers))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment