本文整理汇总了Python中multiprocessing.forking.Popen.thread_is_spawning方法的典型用法代码示例。如果您正苦于以下问题:Python Popen.thread_is_spawning方法的具体用法?Python Popen.thread_is_spawning怎么用?Python Popen.thread_is_spawning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类multiprocessing.forking.Popen
的用法示例。
在下文中一共展示了Popen.thread_is_spawning方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reduce_handle
# 需要导入模块: from multiprocessing.forking import Popen [as 别名]
# 或者: from multiprocessing.forking.Popen import thread_is_spawning [as 别名]
def reduce_handle(handle):
if Popen.thread_is_spawning():
return (None, Popen.duplicate_for_child(handle), True)
dup_handle = duplicate(handle)
_cache.add(dup_handle)
sub_debug('reducing handle %d', handle)
return (_get_listener().address, dup_handle, False)
示例2: __reduce__
# 需要导入模块: from multiprocessing.forking import Popen [as 别名]
# 或者: from multiprocessing.forking.Popen import thread_is_spawning [as 别名]
def __reduce__(self):
from multiprocessing.forking import Popen
if not Popen.thread_is_spawning():
raise TypeError(
'Pickling an AuthenticationString object is '
'disallowed for security reasons'
)
return AuthenticationString, (bytes(self),)