multiprocessing.JoinableQueue.join()

join() Block until all items in the queue have been gotten and processed. The count of unfinished tasks goes up whenever an item is added to the queue. The count goes down whenever a consumer calls task_done() to indicate that the item was retrieved and all work on it is complete. When the count of unfinished tasks drops to zero, join() unblocks.

multiprocessing.JoinableQueue

class multiprocessing.JoinableQueue([maxsize]) JoinableQueue, a Queue subclass, is a queue which additionally has task_done() and join() methods. task_done() Indicate that a formerly enqueued task is complete. Used by queue consumers. For each get() used to fetch a task, a subsequent call to task_done() tells the queue that the processing on the task is complete. If a join() is currently blocking, it will resume when all items have been processed (meaning that a task_done() call was recei

multiprocessing.get_start_method()

multiprocessing.get_start_method(allow_none=False) Return the name of start method used for starting processes. If the start method has not been fixed and allow_none is false, then the start method is fixed to the default and the name is returned. If the start method has not been fixed and allow_none is true then None is returned. The return value can be 'fork', 'spawn', 'forkserver' or None. 'fork' is the default on Unix, while 'spawn' is the default on Windows. New in version 3.4.

multiprocessing.get_logger()

multiprocessing.get_logger() Returns the logger used by multiprocessing. If necessary, a new one will be created. When first created the logger has level logging.NOTSET and no default handler. Messages sent to this logger will not by default propagate to the root logger. Note that on Windows child processes will only inherit the level of the parent process’s logger – any other customization of the logger will not be inherited.

multiprocessing.get_context()

multiprocessing.get_context(method=None) Return a context object which has the same attributes as the multiprocessing module. If method is None then the default context is returned. Otherwise method should be 'fork', 'spawn', 'forkserver'. ValueError is raised if the specified start method is not available. New in version 3.4.

multiprocessing.get_all_start_methods()

multiprocessing.get_all_start_methods() Returns a list of the supported start methods, the first of which is the default. The possible start methods are 'fork', 'spawn' and 'forkserver'. On Windows only 'spawn' is available. On Unix 'fork' and 'spawn' are always supported, with 'fork' being the default. New in version 3.4.

multiprocessing.freeze_support()

multiprocessing.freeze_support() Add support for when a program which uses multiprocessing has been frozen to produce a Windows executable. (Has been tested with py2exe, PyInstaller and cx_Freeze.) One needs to call this function straight after the if __name__ == '__main__' line of the main module. For example: from multiprocessing import Process, freeze_support def f(): print('hello world!') if __name__ == '__main__': freeze_support() Process(target=f).start() If the freeze_s

multiprocessing.Event

class multiprocessing.Event A clone of threading.Event.

multiprocessing.current_process()

multiprocessing.current_process() Return the Process object corresponding to the current process. An analogue of threading.current_thread().

multiprocessing.cpu_count()

multiprocessing.cpu_count() Return the number of CPUs in the system. May raise NotImplementedError. See also os.cpu_count()