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


Python synchronize.Condition方法代码示例

本文整理汇总了Python中multiprocessing.synchronize.Condition方法的典型用法代码示例。如果您正苦于以下问题:Python synchronize.Condition方法的具体用法?Python synchronize.Condition怎么用?Python synchronize.Condition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在multiprocessing.synchronize的用法示例。


在下文中一共展示了synchronize.Condition方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Manager

# 需要导入模块: from multiprocessing import synchronize [as 别名]
# 或者: from multiprocessing.synchronize import Condition [as 别名]
def Manager():
    '''
    Returns a manager associated with a running server process

    The managers methods such as `Lock()`, `Condition()` and `Queue()`
    can be used to create shared objects.
    '''
    from multiprocessing.managers import SyncManager
    m = SyncManager()
    m.start()
    return m

#brython fix me
#def Pipe(duplex=True):
#    '''
#    Returns two connection object connected by a pipe
#    '''
#    from multiprocessing.connection import Pipe
#    return Pipe(duplex) 
开发者ID:war-and-code,项目名称:jawfish,代码行数:21,代码来源:__init__.py

示例2: Manager

# 需要导入模块: from multiprocessing import synchronize [as 别名]
# 或者: from multiprocessing.synchronize import Condition [as 别名]
def Manager():
    '''
    Returns a manager associated with a running server process

    The managers methods such as `Lock()`, `Condition()` and `Queue()`
    can be used to create shared objects.
    '''
    from multiprocessing.managers import SyncManager
    m = SyncManager()
    m.start()
    return m 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:13,代码来源:__init__.py

示例3: Condition

# 需要导入模块: from multiprocessing import synchronize [as 别名]
# 或者: from multiprocessing.synchronize import Condition [as 别名]
def Condition(lock=None):
    '''
    Returns a condition object
    '''
    from multiprocessing.synchronize import Condition
    return Condition(lock) 
开发者ID:war-and-code,项目名称:jawfish,代码行数:8,代码来源:__init__.py

示例4: _after_fork

# 需要导入模块: from multiprocessing import synchronize [as 别名]
# 或者: from multiprocessing.synchronize import Condition [as 别名]
def _after_fork(self):
        debug('Queue._after_fork()')
        self._notempty = threading.Condition(threading.Lock())
        self._buffer = collections.deque()
        self._thread = None
        self._jointhread = None
        self._joincancelled = False
        self._closed = False
        self._close = None
        self._send = self._writer.send
        self._recv = self._reader.recv
        self._poll = self._reader.poll 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:14,代码来源:queues.py

示例5: __init__

# 需要导入模块: from multiprocessing import synchronize [as 别名]
# 或者: from multiprocessing.synchronize import Condition [as 别名]
def __init__(self, maxsize=0):
        Queue.__init__(self, maxsize)
        self._unfinished_tasks = Semaphore(0)
        self._cond = Condition() 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:6,代码来源:queues.py

示例6: Condition

# 需要导入模块: from multiprocessing import synchronize [as 别名]
# 或者: from multiprocessing.synchronize import Condition [as 别名]
def Condition(self, lock=None):
            """Returns a condition object"""
            from .synchronize import Condition
            return Condition(lock) 
开发者ID:joblib,项目名称:loky,代码行数:6,代码来源:context.py


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