本文整理汇总了Python中EDUtilsParallel.EDUtilsParallel.getSemaphoreValue方法的典型用法代码示例。如果您正苦于以下问题:Python EDUtilsParallel.getSemaphoreValue方法的具体用法?Python EDUtilsParallel.getSemaphoreValue怎么用?Python EDUtilsParallel.getSemaphoreValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EDUtilsParallel.EDUtilsParallel
的用法示例。
在下文中一共展示了EDUtilsParallel.getSemaphoreValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: finallyProcess
# 需要导入模块: from EDUtilsParallel import EDUtilsParallel [as 别名]
# 或者: from EDUtilsParallel.EDUtilsParallel import getSemaphoreValue [as 别名]
def finallyProcess(self, _edObject=None):
"""
after processing of the plugin:
Release a CPU resource by releasing the semaphore
"""
EDPlugin.finallyProcess(self, _edObject)
EDVerbose.DEBUG("Release semaphore nbCPU by plugin %s, currently value: %s" % (self.getPluginName(), EDUtilsParallel.getSemaphoreValue()))
EDUtilsParallel.semaphoreNbThreadsRelease()
EDPlugin.finallyProcess(self, _edObject)
示例2: preProcess
# 需要导入模块: from EDUtilsParallel import EDUtilsParallel [as 别名]
# 或者: from EDUtilsParallel.EDUtilsParallel import getSemaphoreValue [as 别名]
def preProcess(self, _edObject=None):
"""
preProcess of the plugin:
Ensure a CPU resource is available for the processing by acquiring a semaphore
"""
EDVerbose.DEBUG("Acquire semaphore nbCPU by plugin %s, currently value: %s" % (self.getPluginName(), EDUtilsParallel.getSemaphoreValue()))
EDUtilsParallel.semaphoreNbThreadsAcquire()
EDPlugin.preProcess(self, _edObject)