当前位置: 首页>>代码示例>>Python>>正文


Python Process.signal方法代码示例

本文整理汇总了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))
开发者ID:EricACooper,项目名称:testrunner,代码行数:37,代码来源:subdoc_autotestgenerator.py


注:本文中的multiprocessing.Process.signal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。