{
    "content": [
        {
            "type": "text",
            "text": "# multiprocessing (pydoc)\n\n**Summary:** multiprocessing\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **DESCRIPTION** (13 lines)\n- **PACKAGE CONTENTS** (22 lines)\n- **SUBMODULES** (2 lines)\n- **CLASSES** (8 lines) — 5 subsections\n  - class AuthenticationError (68 lines)\n  - class BufferTooShort (68 lines)\n  - class Process (71 lines)\n  - class ProcessError (67 lines)\n  - class TimeoutError (68 lines)\n- **FUNCTIONS** (54 lines) — 14 subsections\n  - active_children (2 lines)\n  - allow_connection_pickling (3 lines)\n  - cpu_count (2 lines)\n  - current_process (2 lines)\n  - freeze_support (3 lines)\n  - get_all_start_methods (1 lines)\n  - get_context (1 lines)\n  - get_logger (3 lines)\n  - get_start_method (1 lines)\n  - log_to_stderr (2 lines)\n  - parent_process (2 lines)\n  - set_executable (4 lines)\n  - set_forkserver_preload (3 lines)\n  - set_start_method (1 lines)\n- **DATA** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nmultiprocessing\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/multiprocessing.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n\n### DESCRIPTION\n\n# Package analogous to 'threading.py' but using processes\n#\n# multiprocessing/init.py\n#\n# This package is intended to duplicate the functionality (and much of\n# the API) of threading.py but uses processes instead of threads.  A\n# subpackage 'multiprocessing.dummy' has the same API but is a simple\n# wrapper for 'threading'.\n#\n# Copyright (c) 2006-2008, R Oudkerk\n# Licensed to PSF under a Contributor Agreement.\n#\n\n### PACKAGE CONTENTS\n\nconnection\ncontext\ndummy (package)\nforkserver\nheap\nmanagers\npool\npopenfork\npopenforkserver\npopenspawnposix\npopenspawnwin32\nprocess\nqueues\nreduction\nresourcesharer\nresourcetracker\nsharedmemory\nsharedctypes\nspawn\nsynchronize\nutil\n\n### SUBMODULES\n\nreducer\n\n### CLASSES\n\nbuiltins.Exception(builtins.BaseException)\nmultiprocessing.context.ProcessError\nmultiprocessing.context.AuthenticationError\nmultiprocessing.context.BufferTooShort\nmultiprocessing.context.TimeoutError\nmultiprocessing.process.BaseProcess(builtins.object)\nmultiprocessing.context.Process\n\n#### class AuthenticationError\n\n|  Method resolution order:\n|      AuthenticationError\n|      ProcessError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from ProcessError:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class BufferTooShort\n\n|  Method resolution order:\n|      BufferTooShort\n|      ProcessError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from ProcessError:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class Process\n\n|  Process(group=None, target=None, name=None, args=(), kwargs={}, *, daemon=None)\n|\n|  Method resolution order:\n|      Process\n|      multiprocessing.process.BaseProcess\n|      builtins.object\n|\n|  Methods inherited from multiprocessing.process.BaseProcess:\n|\n|  init(self, group=None, target=None, name=None, args=(), kwargs={}, *, daemon=None)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  repr(self)\n|      Return repr(self).\n|\n|  close(self)\n|      Close the Process object.\n|\n|      This method releases resources held by the Process object.  It is\n|      an error to call this method if the child process is still running.\n|\n|  isalive(self)\n|      Return whether process is alive\n|\n|  join(self, timeout=None)\n|      Wait until child process terminates\n|\n|  kill(self)\n|      Terminate process; sends SIGKILL signal or uses TerminateProcess()\n|\n|  run(self)\n|      Method to be run in sub-process; can be overridden in sub-class\n|\n|  start(self)\n|      Start child process\n|\n|  terminate(self)\n|      Terminate process; sends SIGTERM signal or uses TerminateProcess()\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties inherited from multiprocessing.process.BaseProcess:\n|\n|  exitcode\n|      Return exit code of process or `None` if it has yet to stop\n|\n|  ident\n|      Return identifier (PID) of process or `None` if it has yet to start\n|\n|  pid\n|      Return identifier (PID) of process or `None` if it has yet to start\n|\n|  sentinel\n|      Return a file descriptor (Unix) or handle (Windows) suitable for\n|      waiting for process termination.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from multiprocessing.process.BaseProcess:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  authkey\n|\n|  daemon\n|      Return whether process is a daemon\n|\n|  name\n\n#### class ProcessError\n\n|  Method resolution order:\n|      ProcessError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class TimeoutError\n\n|  Method resolution order:\n|      TimeoutError\n|      ProcessError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from ProcessError:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n### FUNCTIONS\n\nArray(typecodeortype, sizeorinitializer, *, lock=True) method of multiprocessing.context.DefaultContext instance\nReturns a synchronized shared array\n\nBarrier(parties, action=None, timeout=None) method of multiprocessing.context.DefaultContext instance\nReturns a barrier object\n\nBoundedSemaphore(value=1) method of multiprocessing.context.DefaultContext instance\nReturns a bounded semaphore object\n\nCondition(lock=None) method of multiprocessing.context.DefaultContext instance\nReturns a condition object\n\nEvent() method of multiprocessing.context.DefaultContext instance\nReturns an event object\n\nJoinableQueue(maxsize=0) method of multiprocessing.context.DefaultContext instance\nReturns a queue object\n\nLock() method of multiprocessing.context.DefaultContext instance\nReturns a non-recursive lock object\n\nManager() method of multiprocessing.context.DefaultContext instance\nReturns a manager associated with a running server process\n\nThe managers methods such as `Lock()`, `Condition()` and `Queue()`\ncan be used to create shared objects.\n\nPipe(duplex=True) method of multiprocessing.context.DefaultContext instance\nReturns two connection object connected by a pipe\n\nPool(processes=None, initializer=None, initargs=(), maxtasksperchild=None) method of multiprocessing.context.DefaultContext instance\nReturns a process pool object\n\nQueue(maxsize=0) method of multiprocessing.context.DefaultContext instance\nReturns a queue object\n\nRLock() method of multiprocessing.context.DefaultContext instance\nReturns a recursive lock object\n\nRawArray(typecodeortype, sizeorinitializer) method of multiprocessing.context.DefaultContext instance\nReturns a shared array\n\nRawValue(typecodeortype, *args) method of multiprocessing.context.DefaultContext instance\nReturns a shared object\n\nSemaphore(value=1) method of multiprocessing.context.DefaultContext instance\nReturns a semaphore object\n\nSimpleQueue() method of multiprocessing.context.DefaultContext instance\nReturns a queue object\n\nValue(typecodeortype, *args, lock=True) method of multiprocessing.context.DefaultContext instance\nReturns a synchronized shared object\n\n#### active_children\n\nReturn list of process objects corresponding to live child processes\n\n#### allow_connection_pickling\n\nInstall support for sending connections and sockets\nbetween processes\n\n#### cpu_count\n\nReturns the number of CPUs in the system\n\n#### current_process\n\nReturn process object representing the current process\n\n#### freeze_support\n\nCheck whether this is a fake forked process in a frozen executable.\nIf so then run code specified by commandline and exit.\n\n#### get_all_start_methods\n\n#### get_context\n\n#### get_logger\n\nReturn package logger -- if it does not already exist then\nit is created.\n\n#### get_start_method\n\n#### log_to_stderr\n\nTurn on logging and add a handler which prints to stderr\n\n#### parent_process\n\nReturn process object representing the parent process\n\n#### set_executable\n\nSets the path to a python.exe or pythonw.exe binary used to run\nchild processes instead of sys.executable when using the 'spawn'\nstart method.  Useful for people embedding Python.\n\n#### set_forkserver_preload\n\nSet list of module names to try to load in forkserver process.\nThis is really just a hint.\n\n#### set_start_method\n\n### DATA\n\nall = ['Array', 'AuthenticationError', 'Barrier', 'BoundedSemaphor...\n\n### FILE\n\n/usr/lib/python3.10/multiprocessing/init.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "multiprocessing",
        "section": "",
        "mode": "pydoc",
        "summary": "multiprocessing",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "MODULE REFERENCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "PACKAGE CONTENTS",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "SUBMODULES",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 8,
                "subsections": [
                    {
                        "name": "class AuthenticationError",
                        "lines": 68
                    },
                    {
                        "name": "class BufferTooShort",
                        "lines": 68
                    },
                    {
                        "name": "class Process",
                        "lines": 71
                    },
                    {
                        "name": "class ProcessError",
                        "lines": 67
                    },
                    {
                        "name": "class TimeoutError",
                        "lines": 68
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 54,
                "subsections": [
                    {
                        "name": "active_children",
                        "lines": 2
                    },
                    {
                        "name": "allow_connection_pickling",
                        "lines": 3
                    },
                    {
                        "name": "cpu_count",
                        "lines": 2
                    },
                    {
                        "name": "current_process",
                        "lines": 2
                    },
                    {
                        "name": "freeze_support",
                        "lines": 3
                    },
                    {
                        "name": "get_all_start_methods",
                        "lines": 1
                    },
                    {
                        "name": "get_context",
                        "lines": 1
                    },
                    {
                        "name": "get_logger",
                        "lines": 3
                    },
                    {
                        "name": "get_start_method",
                        "lines": 1
                    },
                    {
                        "name": "log_to_stderr",
                        "lines": 2
                    },
                    {
                        "name": "parent_process",
                        "lines": 2
                    },
                    {
                        "name": "set_executable",
                        "lines": 4
                    },
                    {
                        "name": "set_forkserver_preload",
                        "lines": 3
                    },
                    {
                        "name": "set_start_method",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}