本文整理汇总了Python中multiprocessing.Process.signal方法的典型用法代码示例。如果您正苦于以下问题:Python Process.signal方法的具体用法?Python Process.signal怎么用?Python Process.signal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类multiprocessing.Process
的用法示例。
在下文中一共展示了Process.signal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_mutation_operations
# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import signal [as 别名]
def test_mutation_operations(self):
self.run_load_during_mutations = self.input.param("run_load_during_mutations",False)
self.number_of_documents = self.input.param("number_of_documents",10)
self.number_of_operations = self.input.param("number_of_operations",10)
self.concurrent_threads = self.input.param("concurrent_threads",10)
error_queue = Queue.Queue()
document_info_queue = Queue.Queue()
thread_list = []
# RUN INPUT FILE READ THREAD
document_push = threading.Thread(target=self.push_document_info, args = (self.number_of_documents, document_info_queue))
document_push.start()
document_push.join()
self.sleep(2)
# RUN WORKER THREADS
for bucket in self.buckets:
for x in range(self.concurrent_threads*len(self.buckets)):
t = Process(target=self.worker_operation_run, args = (document_info_queue, error_queue, bucket, self.mutation_operation_type, self.force_operation_type))
t.start()
thread_list.append(t)
if self.run_load_during_mutations:
self.run_async_data()
for t in thread_list:
t.join()
for t in self.load_thread_list:
if t.is_alive():
if t != None:
t.signal = False
# ERROR ANALYSIS
error_msg =""
error_count = 0
if not error_queue.empty():
# Dump Re-run file
filename = '/tmp/dump_failure_{0}.txt'.format(self.randomDataGenerator.self.randomDataGenerator.random_uuid())
self._dump_data(filename, error_queue)
self.assertTrue(queue_size == 0, "error count {0}, see error dump {1}".format(queue_size, filename))