本文整理汇总了Python中multiprocessing.Process._bootstrap方法的典型用法代码示例。如果您正苦于以下问题:Python Process._bootstrap方法的具体用法?Python Process._bootstrap怎么用?Python Process._bootstrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类multiprocessing.Process
的用法示例。
在下文中一共展示了Process._bootstrap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _bootstrap
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import _bootstrap [as 别名]
def _bootstrap(self):
cov = coverage(data_suffix=True)
cov.start()
try:
return Process._bootstrap(self)
finally:
cov.stop()
cov.save()
示例2: buildThread
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import _bootstrap [as 别名]
class buildThread(object):
def __init__(self, target, clicrud, **kwargs):
self._kwargs = kwargs
self._kwargs['setup'] = clicrud
self._q = Queue()
self._finq = Queue()
self._ranonceq = Queue()
self._target = target
self._clicrud = clicrud
self._ranonce = False
def __str__(self):
return str(self._kwargs)
def output(self):
return self._q.get()
def prettyOutput(self):
_output = self._q.get()
_return = ""
for k, v in _output.iteritems():
_return += "\n\nCOMMAND: " + k + "--------------------\r\n\n"
_return += v + "\n"
return _return
@property
def finq(self):
return self._finq.get(timeout=600)
def start(self):
self._t = Process(target=self._target,
args=(self._q,
self._finq,
self._ranonceq),
kwargs=self._kwargs,)
self._t.start()
def stop(self):
self._t.terminate()
def join(self):
self._t.join()
def run(self):
self._t.run()
@property
def ranonce(self):
return self._ranonceq.get(timeout=1800)
def getPID(self):
return self._t.pid
def test(self):
return self._t._bootstrap()
示例3: _bootstrap
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import _bootstrap [as 别名]
def _bootstrap(self):
forking.prepare({'main_path': self._main_path})
self._target, self._args, self._kwargs = pickle.loads(self._data)
return Process._bootstrap(self)