multiprocessing.set_start_method()

multiprocessing.set_start_method(method) Set the method which should be used to start child processes. method can be 'fork', 'spawn' or 'forkserver'. Note that this should be called at most once, and it should be protected inside the if __name__ == '__main__' clause of the main module. New in version 3.4.

multiprocessing.set_executable()

multiprocessing.set_executable() Sets the path of the Python interpreter to use when starting a child process. (By default sys.executable is used). Embedders will probably need to do some thing like set_executable(os.path.join(sys.exec_prefix, 'pythonw.exe')) before they can create child processes. Changed in version 3.4: Now supported on Unix when the 'spawn' start method is used.

multiprocessing.Semaphore

class multiprocessing.Semaphore([value]) A semaphore object: a close analog of threading.Semaphore. A solitary difference from its close analog exists: its acquire method’s first argument is named block, as is consistent with Lock.acquire().

multiprocessing.RLock.release()

release() Release a lock, decrementing the recursion level. If after the decrement the recursion level is zero, reset the lock to unlocked (not owned by any process or thread) and if any other processes or threads are blocked waiting for the lock to become unlocked, allow exactly one of them to proceed. If after the decrement the recursion level is still nonzero, the lock remains locked and owned by the calling process or thread. Only call this method when the calling process or thread owns

multiprocessing.RLock.acquire()

acquire(block=True, timeout=None) Acquire a lock, blocking or non-blocking. When invoked with the block argument set to True, block until the lock is in an unlocked state (not owned by any process or thread) unless the lock is already owned by the current process or thread. The current process or thread then takes ownership of the lock (if it does not already have ownership) and the recursion level inside the lock increments by one, resulting in a return value of True. Note that there are se

multiprocessing.RLock

class multiprocessing.RLock A recursive lock object: a close analog of threading.RLock. A recursive lock must be released by the process or thread that acquired it. Once a process or thread has acquired a recursive lock, the same process or thread may acquire it again without blocking; that process or thread must release it once for each time it has been acquired. Note that RLock is actually a factory function which returns an instance of multiprocessing.synchronize.RLock initialized with a

multiprocessing.Queue.qsize()

qsize() Return the approximate size of the queue. Because of multithreading/multiprocessing semantics, this number is not reliable. Note that this may raise NotImplementedError on Unix platforms like Mac OS X where sem_getvalue() is not implemented.

multiprocessing.Queue.put_nowait()

put_nowait(obj) Equivalent to put(obj, False).

multiprocessing.Queue.put()

put(obj[, block[, timeout]]) Put obj into the queue. If the optional argument block is True (the default) and timeout is None (the default), block if necessary until a free slot is available. If timeout is a positive number, it blocks at most timeout seconds and raises the queue.Full exception if no free slot was available within that time. Otherwise (block is False), put an item on the queue if a free slot is immediately available, else raise the queue.Full exception (timeout is ignored in

multiprocessing.Queue.join_thread()

join_thread() Join the background thread. This can only be used after close() has been called. It blocks until the background thread exits, ensuring that all data in the buffer has been flushed to the pipe. By default if a process is not the creator of the queue then on exit it will attempt to join the queue’s background thread. The process can call cancel_join_thread() to make join_thread() do nothing.