chunk_id stringlengths 36 36 | source stringclasses 35
values | source_url stringlengths 0 290 | upstream_license stringclasses 1
value | document_id stringlengths 36 36 | chunk_index int64 0 324k | retrieved_at stringclasses 2
values | chunker_version stringclasses 4
values | content_hash stringlengths 15 64 | content stringlengths 50 44.7k | namespace stringclasses 9
values | source_name stringclasses 35
values | raw_text stringlengths 50 44.7k | cleaned_text stringlengths 50 44.7k | tags stringclasses 49
values | collection_name stringclasses 11
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0c4486ad-b6b2-4fba-bfe0-799c05c644b8 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,173 | supabase-export-v2 | 7c168642de6947d4 | for both objects because the system allows only a limited number of named semaphores, and shared memory segments occupy some space in the main memory.)
To select a start method you use the :func:`set_start_method` in
the ``if __name__ == '__main__'`` clause of the main module. For
example:: | trusted_official_docs | CPython Docs | for both objects because the system allows only a limited number of named semaphores, and shared memory segments occupy some space in the main memory.)
To select a start method you use the :func:`set_start_method` in
the ``if __name__ == '__main__'`` clause of the main module. For
example:: | for both objects because the system allows only a limited number of named semaphores, and shared memory segments occupy some space in the main memory.)
To select a start method you use the :func:`set_start_method` in
the ``if __name__ == '__main__'`` clause of the main module. For
example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0c7e2864-941a-424e-b88f-48fc57a563fd | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,291 | supabase-export-v2 | 5fe409baa9ce9877 | When a process exits, it attempts to terminate all of its daemonic child processes.
Note that a daemonic process is not allowed to create child processes. Otherwise a daemonic process would leave its children orphaned if it gets
terminated when its parent process exits. Additionally, these are **not**
Unix daemons or... | trusted_official_docs | CPython Docs | When a process exits, it attempts to terminate all of its daemonic child processes.
Note that a daemonic process is not allowed to create child processes. Otherwise a daemonic process would leave its children orphaned if it gets
terminated when its parent process exits. Additionally, these are **not**
Unix daemons or... | When a process exits, it attempts to terminate all of its daemonic child processes.
Note that a daemonic process is not allowed to create child processes. Otherwise a daemonic process would leave its children orphaned if it gets
terminated when its parent process exits. Additionally, these are **not**
Unix daemons or... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0d616eec-319b-43a1-81bf-a4e1180f66d2 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,734 | supabase-export-v2 | ac66971e57194458 | is possible to run a manager server on one machine and have clients use it from other machines (assuming that the firewalls involved allow it).
Running the following commands creates a server for a single shared queue which
remote clients can access:: | trusted_official_docs | CPython Docs | is possible to run a manager server on one machine and have clients use it from other machines (assuming that the firewalls involved allow it).
Running the following commands creates a server for a single shared queue which
remote clients can access:: | is possible to run a manager server on one machine and have clients use it from other machines (assuming that the firewalls involved allow it).
Running the following commands creates a server for a single shared queue which
remote clients can access:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0dc54242-558a-48db-bad1-caa6f58d39eb | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,755 | supabase-export-v2 | 5d1edd68e5176bd9 | proxy object) does propagate through the manager and so to effectively modify such an item, one could re-assign the modified value to the container proxy::
# create a list proxy and append a mutable object (a dictionary)
lproxy = manager.list()
lproxy.append({})
# now mutate the dictionary
d = lproxy[0]
d['a'] = 1... | trusted_official_docs | CPython Docs | proxy object) does propagate through the manager and so to effectively modify such an item, one could re-assign the modified value to the container proxy::
# create a list proxy and append a mutable object (a dictionary)
lproxy = manager.list()
lproxy.append({})
# now mutate the dictionary
d = lproxy[0]
d['a'] = 1... | proxy object) does propagate through the manager and so to effectively modify such an item, one could re-assign the modified value to the container proxy::
# create a list proxy and append a mutable object (a dictionary)
lproxy = manager.list()
lproxy.append({})
# now mutate the dictionary
d = lproxy[0]
d['a'] = 1... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0ed47760-cd93-49b7-b902-f03d61f70b8e | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,538 | supabase-export-v2 | b17c5dd27ec68603 | .. class:: Lock()
A non-recursive lock object: a close analog of :class:`threading.Lock`. Once a process or thread has acquired a lock, subsequent attempts to
acquire it from any process or thread will block until it is released;
any process or thread may release it. The concepts and behaviors of
:class:`threading.L... | trusted_official_docs | CPython Docs | .. class:: Lock()
A non-recursive lock object: a close analog of :class:`threading.Lock`. Once a process or thread has acquired a lock, subsequent attempts to
acquire it from any process or thread will block until it is released;
any process or thread may release it. The concepts and behaviors of
:class:`threading.L... | .. class:: Lock()
A non-recursive lock object: a close analog of :class:`threading.Lock`. Once a process or thread has acquired a lock, subsequent attempts to
acquire it from any process or thread will block until it is released;
any process or thread may release it. The concepts and behaviors of
:class:`threading.L... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0fd59840-7759-4c2c-b50d-34b11f697de6 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,585 | supabase-export-v2 | 2a0423751f5afe41 | default the return value is actually a synchronized wrapper for the object. The object itself can be accessed via the *value* attribute of a :class:`Value`.
*typecode_or_type* determines the type of the returned object: it is either a
ctypes type or a one character typecode of the kind used by the :mod:`array`
module... | trusted_official_docs | CPython Docs | default the return value is actually a synchronized wrapper for the object. The object itself can be accessed via the *value* attribute of a :class:`Value`.
*typecode_or_type* determines the type of the returned object: it is either a
ctypes type or a one character typecode of the kind used by the :mod:`array`
module... | default the return value is actually a synchronized wrapper for the object. The object itself can be accessed via the *value* attribute of a :class:`Value`.
*typecode_or_type* determines the type of the returned object: it is either a
ctypes type or a one character typecode of the kind used by the :mod:`array`
module... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1033da61-e029-430f-aaaa-46e38efcbd4b | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,676 | supabase-export-v2 | 9b1a2df519df58ca | shared object will be accessible. (Here a "public method" means any attribute which has a :meth:`~object.__call__` method and whose name does not begin with ``'_'``.)
*method_to_typeid* is a mapping used to specify the return type of those
exposed methods which should return a proxy. It maps method names to
typeid st... | trusted_official_docs | CPython Docs | shared object will be accessible. (Here a "public method" means any attribute which has a :meth:`~object.__call__` method and whose name does not begin with ``'_'``.)
*method_to_typeid* is a mapping used to specify the return type of those
exposed methods which should return a proxy. It maps method names to
typeid st... | shared object will be accessible. (Here a "public method" means any attribute which has a :meth:`~object.__call__` method and whose name does not begin with ``'_'``.)
*method_to_typeid* is a mapping used to specify the return type of those
exposed methods which should return a proxy. It maps method names to
typeid st... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
106d19ef-f076-4d30-bc9a-78b6fbb7b938 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,932 | supabase-export-v2 | a67b6a4670d1f8ce | package does not use process shared locks so it is possible (depending on the handler type) for messages from different processes to get mixed up.
.. currentmodule:: multiprocessing
.. function:: get_logger() | trusted_official_docs | CPython Docs | package does not use process shared locks so it is possible (depending on the handler type) for messages from different processes to get mixed up.
.. currentmodule:: multiprocessing
.. function:: get_logger() | package does not use process shared locks so it is possible (depending on the handler type) for messages from different processes to get mixed up.
.. currentmodule:: multiprocessing
.. function:: get_logger() | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1166b830-5f57-4453-a99c-5d02fef4276b | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,798 | supabase-export-v2 | 216f8be5027df44e | the pool as a context manager or by calling :meth:`close` and :meth:`terminate` manually. Failure to do this can lead to the process hanging on finalization.
Note that it is **not correct** to rely on the garbage collector to destroy the pool
as CPython does not assure that the finalizer of the pool will be called
(s... | trusted_official_docs | CPython Docs | the pool as a context manager or by calling :meth:`close` and :meth:`terminate` manually. Failure to do this can lead to the process hanging on finalization.
Note that it is **not correct** to rely on the garbage collector to destroy the pool
as CPython does not assure that the finalizer of the pool will be called
(s... | the pool as a context manager or by calling :meth:`close` and :meth:`terminate` manually. Failure to do this can lead to the process hanging on finalization.
Note that it is **not correct** to rely on the garbage collector to destroy the pool
as CPython does not assure that the finalizer of the pool will be called
(s... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11a1a1af-b41a-438c-8831-cdd9a3e90709 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,877 | supabase-export-v2 | 7235f230d5141e56 | of '0.0.0.0' is used, the address will not be a connectable end point on Windows. If you require a connectable end-point, you should use '127.0.0.1'.
*family* is the type of socket (or named pipe) to use. This can be one of
the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix
domain socket) or ``'A... | trusted_official_docs | CPython Docs | of '0.0.0.0' is used, the address will not be a connectable end point on Windows. If you require a connectable end-point, you should use '127.0.0.1'.
*family* is the type of socket (or named pipe) to use. This can be one of
the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix
domain socket) or ``'A... | of '0.0.0.0' is used, the address will not be a connectable end point on Windows. If you require a connectable end-point, you should use '127.0.0.1'.
*family* is the type of socket (or named pipe) to use. This can be one of
the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix
domain socket) or ``'A... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11a93ce0-f4c1-43b7-945e-3ed51544cf2e | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,346 | supabase-export-v2 | 8f2d443f7f1053eb | .. note::
When an object is put on a queue, the object is pickled and a
background thread later flushes the pickled data to an underlying
pipe. This has some consequences which are a little surprising,
but should not cause any practical difficulties -- if they really
bother you then you can instead use a queue crea... | trusted_official_docs | CPython Docs | .. note::
When an object is put on a queue, the object is pickled and a
background thread later flushes the pickled data to an underlying
pipe. This has some consequences which are a little surprising,
but should not cause any practical difficulties -- if they really
bother you then you can instead use a queue crea... | .. note::
When an object is put on a queue, the object is pickled and a
background thread later flushes the pickled data to an underlying
pipe. This has some consequences which are a little surprising,
but should not cause any practical difficulties -- if they really
bother you then you can instead use a queue crea... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11ec90bd-2996-42f4-9712-4a68661cc44f | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,268 | supabase-export-v2 | 4f7342f725ea3f4e | true if using the ``"fork"`` start method, as of Python ``3.14`` that is no longer the default on any platform. See :ref:`multiprocessing-start-methods`. See also :gh:`132898`.
.. versionchanged:: 3.3
Added the *daemon* parameter. | trusted_official_docs | CPython Docs | true if using the ``"fork"`` start method, as of Python ``3.14`` that is no longer the default on any platform. See :ref:`multiprocessing-start-methods`. See also :gh:`132898`.
.. versionchanged:: 3.3
Added the *daemon* parameter. | true if using the ``"fork"`` start method, as of Python ``3.14`` that is no longer the default on any platform. See :ref:`multiprocessing-start-methods`. See also :gh:`132898`.
.. versionchanged:: 3.3
Added the *daemon* parameter. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
123bc325-987c-479b-a1af-16808fdd5ed5 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,587 | supabase-export-v2 | 7a6d5d2bf3032817 | If *lock* is ``False`` then access to the returned object will not be automatically protected by a lock, so it will not necessarily be "process-safe".
Operations like ``+=`` which involve a read and write are not
atomic. So if, for instance, you want to atomically increment a
shared value it is insufficient to just d... | trusted_official_docs | CPython Docs | If *lock* is ``False`` then access to the returned object will not be automatically protected by a lock, so it will not necessarily be "process-safe".
Operations like ``+=`` which involve a read and write are not
atomic. So if, for instance, you want to atomically increment a
shared value it is insufficient to just d... | If *lock* is ``False`` then access to the returned object will not be automatically protected by a lock, so it will not necessarily be "process-safe".
Operations like ``+=`` which involve a read and write are not
atomic. So if, for instance, you want to atomically increment a
shared value it is insufficient to just d... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1244a74b-81c2-4f70-bf7b-af62f51d92e7 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 7,013 | supabase-export-v2 | e2459b80854761bf | sure that the main module can be safely imported by a new Python interpreter without causing unintended side effects (such as starting a new process).
For example, using the *spawn* or *forkserver* start method
running the following module would fail with a
:exc:`RuntimeError`:: | trusted_official_docs | CPython Docs | sure that the main module can be safely imported by a new Python interpreter without causing unintended side effects (such as starting a new process).
For example, using the *spawn* or *forkserver* start method
running the following module would fail with a
:exc:`RuntimeError`:: | sure that the main module can be safely imported by a new Python interpreter without causing unintended side effects (such as starting a new process).
For example, using the *spawn* or *forkserver* start method
running the following module would fail with a
:exc:`RuntimeError`:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1584f65c-b4a6-40e4-ace5-e31e02bec7f2 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,793 | supabase-export-v2 | 2ad9758557639b73 | *processes* is the number of worker processes to use. If *processes* is ``None`` then the number returned by :func:`os.process_cpu_count` is used.
If *initializer* is not ``None`` then each worker process will call
``initializer(*initargs)`` when it starts. | trusted_official_docs | CPython Docs | *processes* is the number of worker processes to use. If *processes* is ``None`` then the number returned by :func:`os.process_cpu_count` is used.
If *initializer* is not ``None`` then each worker process will call
``initializer(*initargs)`` when it starts. | *processes* is the number of worker processes to use. If *processes* is ``None`` then the number returned by :func:`os.process_cpu_count` is used.
If *initializer* is not ``None`` then each worker process will call
``initializer(*initargs)`` when it starts. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
15c8849a-2826-4a0b-ba85-449f2826858d | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,354 | supabase-export-v2 | 5394d29e700ca553 | consumed. Similarly, if the child process is non-daemonic then the parent process may hang on exit when it tries to join all its non-daemonic children.
Note that a queue created using a manager does not have this issue. See
:ref:`multiprocessing-programming`. | trusted_official_docs | CPython Docs | consumed. Similarly, if the child process is non-daemonic then the parent process may hang on exit when it tries to join all its non-daemonic children.
Note that a queue created using a manager does not have this issue. See
:ref:`multiprocessing-programming`. | consumed. Similarly, if the child process is non-daemonic then the parent process may hang on exit when it tries to join all its non-daemonic children.
Note that a queue created using a manager does not have this issue. See
:ref:`multiprocessing-programming`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
175089e6-7d4a-409b-9094-b1ad30ae632c | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,799 | supabase-export-v2 | f5a1b07314711dfd | garbage collector to destroy the pool as CPython does not assure that the finalizer of the pool will be called (see :meth:`object.__del__` for more information).
.. versionchanged:: 3.2
Added the *maxtasksperchild* parameter. | trusted_official_docs | CPython Docs | garbage collector to destroy the pool as CPython does not assure that the finalizer of the pool will be called (see :meth:`object.__del__` for more information).
.. versionchanged:: 3.2
Added the *maxtasksperchild* parameter. | garbage collector to destroy the pool as CPython does not assure that the finalizer of the pool will be called (see :meth:`object.__del__` for more information).
.. versionchanged:: 3.2
Added the *maxtasksperchild* parameter. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
17e048d0-b631-417d-b416-dcb9de3211d2 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,549 | supabase-export-v2 | ca8d085c2e7d15a1 | Release a lock. This can be called from any process or thread, not only the process or thread which originally acquired the lock.
Behavior is the same as in :meth:`threading.Lock.release` except that
when invoked on an unlocked lock, a :exc:`ValueError` is raised. | trusted_official_docs | CPython Docs | Release a lock. This can be called from any process or thread, not only the process or thread which originally acquired the lock.
Behavior is the same as in :meth:`threading.Lock.release` except that
when invoked on an unlocked lock, a :exc:`ValueError` is raised. | Release a lock. This can be called from any process or thread, not only the process or thread which originally acquired the lock.
Behavior is the same as in :meth:`threading.Lock.release` except that
when invoked on an unlocked lock, a :exc:`ValueError` is raised. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
18dbe7f3-d40b-43dc-8b2d-90660d13d066 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,554 | supabase-export-v2 | 78a95f27b4832d33 | 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 :class:`RLock` is actually a factory function which returns an
instance of ``multiprocessing.synchronize.RLock`` initialized with a
default context. | trusted_official_docs | CPython Docs | 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 :class:`RLock` is actually a factory function which returns an
instance of ``multiprocessing.synchronize.RLock`` initialized with a
default context. | 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 :class:`RLock` is actually a factory function which returns an
instance of ``multiprocessing.synchronize.RLock`` initialized with a
default context. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
197e2711-2f61-4719-a228-7bb48118528d | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,164 | supabase-export-v2 | 8d663de463a6ca15 | .. _multiprocessing-start-method-forkserver:
*forkserver*
When the program starts and selects the *forkserver* start method,
a server process is spawned. From then on, whenever a new process
is needed, the parent process connects to the server and requests
that it fork a new process. The fork server process is sing... | trusted_official_docs | CPython Docs | .. _multiprocessing-start-method-forkserver:
*forkserver*
When the program starts and selects the *forkserver* start method,
a server process is spawned. From then on, whenever a new process
is needed, the parent process connects to the server and requests
that it fork a new process. The fork server process is sing... | .. _multiprocessing-start-method-forkserver:
*forkserver*
When the program starts and selects the *forkserver* start method,
a server process is spawned. From then on, whenever a new process
is needed, the parent process connects to the server and requests
that it fork a new process. The fork server process is sing... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
19b74468-362b-4a26-85c8-a42049375d49 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,754 | supabase-export-v2 | 76b652a538274895 | 1 >>> d_first_inner['b'] = 2 >>> l_outer[1]['c'] = 3 >>> l_outer[1]['z'] = 26 >>> print(l_outer[0]) {'a': 1, 'b': 2} >>> print(l_outer[1]) {'c': 3, 'z': 26}
If standard (non-proxy) :class:`list` or :class:`dict` objects are contained
in a referent, modifications to those mutable values will not be propagated
through th... | trusted_official_docs | CPython Docs | 1 >>> d_first_inner['b'] = 2 >>> l_outer[1]['c'] = 3 >>> l_outer[1]['z'] = 26 >>> print(l_outer[0]) {'a': 1, 'b': 2} >>> print(l_outer[1]) {'c': 3, 'z': 26}
If standard (non-proxy) :class:`list` or :class:`dict` objects are contained
in a referent, modifications to those mutable values will not be propagated
through th... | 1 >>> d_first_inner['b'] = 2 >>> l_outer[1]['c'] = 3 >>> l_outer[1]['z'] = 26 >>> print(l_outer[0]) {'a': 1, 'b': 2} >>> print(l_outer[1]) {'c': 3, 'z': 26}
If standard (non-proxy) :class:`list` or :class:`dict` objects are contained
in a referent, modifications to those mutable values will not be propagated
through th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1b496cb1-fa1b-430f-9df1-e3b9f8d5a227 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,718 | supabase-export-v2 | 23f2245a628df582 | .. versionadded:: 3.14 :class:`set` support was added.
.. versionchanged:: 3.6
Shared objects are capable of being nested. For example, a shared
container object such as a shared list can contain other shared objects
which will all be managed and synchronized by the :class:`SyncManager`. | trusted_official_docs | CPython Docs | .. versionadded:: 3.14 :class:`set` support was added.
.. versionchanged:: 3.6
Shared objects are capable of being nested. For example, a shared
container object such as a shared list can contain other shared objects
which will all be managed and synchronized by the :class:`SyncManager`. | .. versionadded:: 3.14 :class:`set` support was added.
.. versionchanged:: 3.6
Shared objects are capable of being nested. For example, a shared
container object such as a shared list can contain other shared objects
which will all be managed and synchronized by the :class:`SyncManager`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1b77e3a4-bd73-42e2-b0ef-207b505af2ca | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,916 | supabase-export-v2 | 7ad96459a8882c01 | This # ensures that when p closes its handle for the writable end, # wait() will promptly report the readable end as being ready. w.close()
while readers:
for r in wait(readers):
try:
msg = r.recv()
except EOFError:
readers.remove(r)
else:
print(msg) | trusted_official_docs | CPython Docs | This # ensures that when p closes its handle for the writable end, # wait() will promptly report the readable end as being ready. w.close()
while readers:
for r in wait(readers):
try:
msg = r.recv()
except EOFError:
readers.remove(r)
else:
print(msg) | This # ensures that when p closes its handle for the writable end, # wait() will promptly report the readable end as being ready. w.close()
while readers:
for r in wait(readers):
try:
msg = r.recv()
except EOFError:
readers.remove(r)
else:
print(msg) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1ba058b9-d6fd-458c-9455-d6e26229b269 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,854 | supabase-export-v2 | 4a6e39b56981af0c | 4 worker processes result = pool.apply_async(f, (10,)) # evaluate "f(10)" asynchronously in a single process print(result.get(timeout=1)) # prints "100" unless your computer is *very* slow
print(pool.map(f, range(10))) # prints "[0, 1, 4,..., 81]" | trusted_official_docs | CPython Docs | 4 worker processes result = pool.apply_async(f, (10,)) # evaluate "f(10)" asynchronously in a single process print(result.get(timeout=1)) # prints "100" unless your computer is *very* slow
print(pool.map(f, range(10))) # prints "[0, 1, 4,..., 81]" | 4 worker processes result = pool.apply_async(f, (10,)) # evaluate "f(10)" asynchronously in a single process print(result.get(timeout=1)) # prints "100" unless your computer is *very* slow
print(pool.map(f, range(10))) # prints "[0, 1, 4,..., 81]" | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1ba8b794-e936-4efd-84c0-a870685233c9 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,748 | supabase-export-v2 | b5233dc8c0aa3bb4 | 1, 4, 9, 16, 25, 36, 49, 64, 81] >>> print(repr(l)) <ListProxy object, typeid 'list' at 0x...> >>> l[4] 16 >>> l[2:5] [4, 9, 16]
Notice that applying :func:`str` to a proxy will return the representation of
the referent, whereas applying :func:`repr` will return the representation of
the proxy. | trusted_official_docs | CPython Docs | 1, 4, 9, 16, 25, 36, 49, 64, 81] >>> print(repr(l)) <ListProxy object, typeid 'list' at 0x...> >>> l[4] 16 >>> l[2:5] [4, 9, 16]
Notice that applying :func:`str` to a proxy will return the representation of
the referent, whereas applying :func:`repr` will return the representation of
the proxy. | 1, 4, 9, 16, 25, 36, 49, 64, 81] >>> print(repr(l)) <ListProxy object, typeid 'list' at 0x...> >>> l[4] 16 >>> l[2:5] [4, 9, 16]
Notice that applying :func:`str` to a proxy will return the representation of
the referent, whereas applying :func:`repr` will return the representation of
the proxy. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1bf1e881-dd08-46b6-917f-a97b7fa54781 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,884 | supabase-export-v2 | 321b72719f065c15 | or named pipe of the listener object. This is called automatically when the listener is garbage collected. However it is advisable to call it explicitly.
Listener objects have the following read-only properties: | trusted_official_docs | CPython Docs | or named pipe of the listener object. This is called automatically when the listener is garbage collected. However it is advisable to call it explicitly.
Listener objects have the following read-only properties: | or named pipe of the listener object. This is called automatically when the listener is garbage collected. However it is advisable to call it explicitly.
Listener objects have the following read-only properties: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1cbecff5-ce06-4ea2-bdae-4a4f60f4e85c | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,938 | supabase-export-v2 | 32f9bc67ddb9e227 | it adds a handler which sends output to :data:`sys.stderr` using format ``'[%(levelname)s/%(processName)s] %(message)s'``. You can modify ``levelname`` of the logger by passing a ``level`` argument.
Below is an example session with logging turned on:: | trusted_official_docs | CPython Docs | it adds a handler which sends output to :data:`sys.stderr` using format ``'[%(levelname)s/%(processName)s] %(message)s'``. You can modify ``levelname`` of the logger by passing a ``level`` argument.
Below is an example session with logging turned on:: | it adds a handler which sends output to :data:`sys.stderr` using format ``'[%(levelname)s/%(processName)s] %(message)s'``. You can modify ``levelname`` of the logger by passing a ``level`` argument.
Below is an example session with logging turned on:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1d336b71-764f-414c-a115-09ebf505122b | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,681 | supabase-export-v2 | bd4dc35880140112 | The address used by the manager.
.. versionchanged:: 3.3
Manager objects support the context management protocol -- see
:ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the
server process (if it has not already started) and then returns the
manager object. :meth:`~contextmanager.__exit__` calls :... | trusted_official_docs | CPython Docs | The address used by the manager.
.. versionchanged:: 3.3
Manager objects support the context management protocol -- see
:ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the
server process (if it has not already started) and then returns the
manager object. :meth:`~contextmanager.__exit__` calls :... | The address used by the manager.
.. versionchanged:: 3.3
Manager objects support the context management protocol -- see
:ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the
server process (if it has not already started) and then returns the
manager object. :meth:`~contextmanager.__exit__` calls :... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1e4c1683-c31f-4f71-9ab9-d3b132bc80ea | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,737 | supabase-export-v2 | 1014e1db9f7a086e | One client can access the server as follows::
>>> from multiprocessing.managers import BaseManager
>>> class QueueManager(BaseManager): pass
>>> QueueManager.register('get_queue')
>>> m = QueueManager(address=('foo.bar.org', 50000), authkey=b'abracadabra')
>>> m.connect()
>>> queue = m.get_queue()
>>> queue.put('... | trusted_official_docs | CPython Docs | One client can access the server as follows::
>>> from multiprocessing.managers import BaseManager
>>> class QueueManager(BaseManager): pass
>>> QueueManager.register('get_queue')
>>> m = QueueManager(address=('foo.bar.org', 50000), authkey=b'abracadabra')
>>> m.connect()
>>> queue = m.get_queue()
>>> queue.put('... | One client can access the server as follows::
>>> from multiprocessing.managers import BaseManager
>>> class QueueManager(BaseManager): pass
>>> QueueManager.register('get_queue')
>>> m = QueueManager(address=('foo.bar.org', 50000), authkey=b'abracadabra')
>>> m.connect()
>>> queue = m.get_queue()
>>> queue.put('... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1ffb0ea7-ca11-4bb2-9741-269eb437145e | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,724 | supabase-export-v2 | 2b423ab1da081a45 | .. doctest::
>>> mp_context = multiprocessing.get_context('spawn')
>>> manager = mp_context.Manager()
>>> Global = manager.Namespace()
>>> Global.x = 10
>>> Global.y = 'hello'
>>> Global._z = 12.3 # this is an attribute of the proxy
>>> print(Global)
Namespace(x=10, y='hello') | trusted_official_docs | CPython Docs | .. doctest::
>>> mp_context = multiprocessing.get_context('spawn')
>>> manager = mp_context.Manager()
>>> Global = manager.Namespace()
>>> Global.x = 10
>>> Global.y = 'hello'
>>> Global._z = 12.3 # this is an attribute of the proxy
>>> print(Global)
Namespace(x=10, y='hello') | .. doctest::
>>> mp_context = multiprocessing.get_context('spawn')
>>> manager = mp_context.Manager()
>>> Global = manager.Namespace()
>>> Global.x = 10
>>> Global.y = 'hello'
>>> Global._z = 12.3 # this is an attribute of the proxy
>>> print(Global)
Namespace(x=10, y='hello') | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
202d6b3b-c431-4feb-900c-60f9d83d682c | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,200 | supabase-export-v2 | cdb88470ee4d3ef3 | pipe at the same time. Of course there is no risk of corruption from processes using different ends of the pipe at the same time.
The :meth:`~Connection.send` method serializes the object and
:meth:`~Connection.recv` re-creates the object. | trusted_official_docs | CPython Docs | pipe at the same time. Of course there is no risk of corruption from processes using different ends of the pipe at the same time.
The :meth:`~Connection.send` method serializes the object and
:meth:`~Connection.recv` re-creates the object. | pipe at the same time. Of course there is no risk of corruption from processes using different ends of the pipe at the same time.
The :meth:`~Connection.send` method serializes the object and
:meth:`~Connection.recv` re-creates the object. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2087d62b-9835-43bb-afce-ab1d06de0431 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,524 | supabase-export-v2 | 9e793bbff5985577 | Instantiating this class may set the global start method. See :ref:`global-start-method` for more details.
A solitary difference from its close analog exists: its ``acquire`` method's
first argument is named *block*, as is consistent with :meth:`Lock.acquire`. | trusted_official_docs | CPython Docs | Instantiating this class may set the global start method. See :ref:`global-start-method` for more details.
A solitary difference from its close analog exists: its ``acquire`` method's
first argument is named *block*, as is consistent with :meth:`Lock.acquire`. | Instantiating this class may set the global start method. See :ref:`global-start-method` for more details.
A solitary difference from its close analog exists: its ``acquire`` method's
first argument is named *block*, as is consistent with :meth:`Lock.acquire`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
20b17dee-02c4-4e29-97df-aa47f15a1499 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,815 | supabase-export-v2 | b16b0116067433ba | Note that it may cause high memory usage for very long iterables. Consider using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* option for better efficiency.
.. method:: map_async(func, iterable[, chunksize[, callback[, error_callback]]]) | trusted_official_docs | CPython Docs | Note that it may cause high memory usage for very long iterables. Consider using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* option for better efficiency.
.. method:: map_async(func, iterable[, chunksize[, callback[, error_callback]]]) | Note that it may cause high memory usage for very long iterables. Consider using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* option for better efficiency.
.. method:: map_async(func, iterable[, chunksize[, callback[, error_callback]]]) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2113db42-1a0b-459a-bad8-7b6ad7b89d13 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 7,009 | supabase-export-v2 | 068d05e102f6112a | value it sees (if any) may not be the same as the value in the parent process at the time that :meth:`Process.start <multiprocessing.Process.start>` was called.
However, global variables which are just module level constants cause no
problems. | trusted_official_docs | CPython Docs | value it sees (if any) may not be the same as the value in the parent process at the time that :meth:`Process.start <multiprocessing.Process.start>` was called.
However, global variables which are just module level constants cause no
problems. | value it sees (if any) may not be the same as the value in the parent process at the time that :meth:`Process.start <multiprocessing.Process.start>` was called.
However, global variables which are just module level constants cause no
problems. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
21156882-47c4-41df-af55-f4350add8377 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,961 | supabase-export-v2 | f80d48cf3fe9af8b | As far as possible one should try to avoid shifting large amounts of data between processes.
It is probably best to stick to using queues or pipes for communication
between processes rather than using the lower level synchronization
primitives. | trusted_official_docs | CPython Docs | As far as possible one should try to avoid shifting large amounts of data between processes.
It is probably best to stick to using queues or pipes for communication
between processes rather than using the lower level synchronization
primitives. | As far as possible one should try to avoid shifting large amounts of data between processes.
It is probably best to stick to using queues or pipes for communication
between processes rather than using the lower level synchronization
primitives. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
218b13c0-3ba5-4532-aa38-c180c2704a78 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,478 | supabase-export-v2 | 0bfc4e3c5072e2f1 | Connection objects allow the sending and receiving of picklable objects or strings. They can be thought of as message oriented connected sockets.
Connection objects are usually created using
:func:`Pipe <multiprocessing.Pipe>` -- see also
:ref:`multiprocessing-listeners-clients`. | trusted_official_docs | CPython Docs | Connection objects allow the sending and receiving of picklable objects or strings. They can be thought of as message oriented connected sockets.
Connection objects are usually created using
:func:`Pipe <multiprocessing.Pipe>` -- see also
:ref:`multiprocessing-listeners-clients`. | Connection objects allow the sending and receiving of picklable objects or strings. They can be thought of as message oriented connected sockets.
Connection objects are usually created using
:func:`Pipe <multiprocessing.Pipe>` -- see also
:ref:`multiprocessing-listeners-clients`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2198bb1c-8314-4481-b331-c553f8639283 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,272 | supabase-export-v2 | 011fff86869c85fb | object passed to the object's constructor as the target argument, if any, with sequential and keyword arguments taken from the *args* and *kwargs* arguments, respectively.
Using a list or tuple as the *args* argument passed to :class:`Process`
achieves the same effect. | trusted_official_docs | CPython Docs | object passed to the object's constructor as the target argument, if any, with sequential and keyword arguments taken from the *args* and *kwargs* arguments, respectively.
Using a list or tuple as the *args* argument passed to :class:`Process`
achieves the same effect. | object passed to the object's constructor as the target argument, if any, with sequential and keyword arguments taken from the *args* and *kwargs* arguments, respectively.
Using a list or tuple as the *args* argument passed to :class:`Process`
achieves the same effect. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
22753da3-76ed-4ea0-8bce-351c0b7f54d7 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,248 | supabase-export-v2 | 10410cceb8d9c505 | it is worth pointing out here. This means that some examples, such as the :class:`multiprocessing.pool.Pool` examples will not work in the interactive interpreter. For example::
>>> from multiprocessing import Pool
>>> p = Pool(5)
>>> def f(x):
... return x*x
... >>> with p:
... p.map(f, [1,2,3])
Process PoolWork... | trusted_official_docs | CPython Docs | it is worth pointing out here. This means that some examples, such as the :class:`multiprocessing.pool.Pool` examples will not work in the interactive interpreter. For example::
>>> from multiprocessing import Pool
>>> p = Pool(5)
>>> def f(x):
... return x*x
... >>> with p:
... p.map(f, [1,2,3])
Process PoolWork... | it is worth pointing out here. This means that some examples, such as the :class:`multiprocessing.pool.Pool` examples will not work in the interactive interpreter. For example::
>>> from multiprocessing import Pool
>>> p = Pool(5)
>>> def f(x):
... return x*x
... >>> with p:
... p.map(f, [1,2,3])
Process PoolWork... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
22e07a52-51fe-4415-8e56-06bb7fd51143 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,922 | supabase-export-v2 | 4706f8b870fcaec2 | To use :func:`Client` to connect to a named pipe on a remote computer called *ServerName* one should use an address of the form :samp:`r'\\\\\\\\{ServerName}\\pipe\\\\{PipeName}'` instead.
Note that any string beginning with two backslashes is assumed by default to be
an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'... | trusted_official_docs | CPython Docs | To use :func:`Client` to connect to a named pipe on a remote computer called *ServerName* one should use an address of the form :samp:`r'\\\\\\\\{ServerName}\\pipe\\\\{PipeName}'` instead.
Note that any string beginning with two backslashes is assumed by default to be
an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'... | To use :func:`Client` to connect to a named pipe on a remote computer called *ServerName* one should use an address of the form :samp:`r'\\\\\\\\{ServerName}\\pipe\\\\{PipeName}'` instead.
Note that any string beginning with two backslashes is assumed by default to be
an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
23a398d5-2ac3-4287-b398-ebd91fbce000 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,597 | supabase-export-v2 | 9ad2740696b674e8 | Note that *lock* is a keyword only argument.
Note that an array of :data:`ctypes.c_char` has *value* and *raw*
attributes which allow one to use it to store and retrieve strings. | trusted_official_docs | CPython Docs | Note that *lock* is a keyword only argument.
Note that an array of :data:`ctypes.c_char` has *value* and *raw*
attributes which allow one to use it to store and retrieve strings. | Note that *lock* is a keyword only argument.
Note that an array of :data:`ctypes.c_char` has *value* and *raw*
attributes which allow one to use it to store and retrieve strings. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2433527e-5a5b-47c6-8664-f95f376a2f6b | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,362 | supabase-export-v2 | 1f0ed7985010fc0f | locks/semaphores. When a process first puts an item on the queue a feeder thread is started which transfers objects from a buffer into the pipe.
Instantiating this class may set the global start method. See
:ref:`global-start-method` for more details. | trusted_official_docs | CPython Docs | locks/semaphores. When a process first puts an item on the queue a feeder thread is started which transfers objects from a buffer into the pipe.
Instantiating this class may set the global start method. See
:ref:`global-start-method` for more details. | locks/semaphores. When a process first puts an item on the queue a feeder thread is started which transfers objects from a buffer into the pipe.
Instantiating this class may set the global start method. See
:ref:`global-start-method` for more details. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
246c6022-e815-4318-816b-95cf2d3a3861 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,364 | supabase-export-v2 | cbe9adc634a5ac58 | The usual :exc:`queue.Empty` and :exc:`queue.Full` exceptions from the standard library's :mod:`queue` module are raised to signal timeouts.
:class:`Queue` implements all the methods of :class:`queue.Queue` except for
:meth:`~queue.Queue.task_done`, :meth:`~queue.Queue.join`, and
:meth:`~queue.Queue.shutdown`. | trusted_official_docs | CPython Docs | The usual :exc:`queue.Empty` and :exc:`queue.Full` exceptions from the standard library's :mod:`queue` module are raised to signal timeouts.
:class:`Queue` implements all the methods of :class:`queue.Queue` except for
:meth:`~queue.Queue.task_done`, :meth:`~queue.Queue.join`, and
:meth:`~queue.Queue.shutdown`. | The usual :exc:`queue.Empty` and :exc:`queue.Full` exceptions from the standard library's :mod:`queue` module are raised to signal timeouts.
:class:`Queue` implements all the methods of :class:`queue.Queue` except for
:meth:`~queue.Queue.task_done`, :meth:`~queue.Queue.join`, and
:meth:`~queue.Queue.shutdown`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
24fc061c-9f13-420a-b572-b1c73497fc94 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,970 | supabase-export-v2 | ffafbed5f3cd15cb | Better to inherit than pickle/unpickle
When using the *spawn* or *forkserver* start methods many types
from :mod:`!multiprocessing` need to be picklable so that child
processes can use them. However, one should generally avoid
sending shared objects to other processes using pipes or queues. Instead you should arrang... | trusted_official_docs | CPython Docs | Better to inherit than pickle/unpickle
When using the *spawn* or *forkserver* start methods many types
from :mod:`!multiprocessing` need to be picklable so that child
processes can use them. However, one should generally avoid
sending shared objects to other processes using pipes or queues. Instead you should arrang... | Better to inherit than pickle/unpickle
When using the *spawn* or *forkserver* start methods many types
from :mod:`!multiprocessing` need to be picklable so that child
processes can use them. However, one should generally avoid
sending shared objects to other processes using pipes or queues. Instead you should arrang... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
25418d65-f6d5-4265-ab81-deb208d9aecd | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,255 | supabase-export-v2 | 526c095db2d508e6 | Python supports several ways to create and initialize a process. The global start method sets the default mechanism for creating a process.
Several multiprocessing functions and methods that may also instantiate
certain objects will implicitly set the global start method to the system's default,
if it hasn’t been set a... | trusted_official_docs | CPython Docs | Python supports several ways to create and initialize a process. The global start method sets the default mechanism for creating a process.
Several multiprocessing functions and methods that may also instantiate
certain objects will implicitly set the global start method to the system's default,
if it hasn’t been set a... | Python supports several ways to create and initialize a process. The global start method sets the default mechanism for creating a process.
Several multiprocessing functions and methods that may also instantiate
certain objects will implicitly set the global start method to the system's default,
if it hasn’t been set a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2574504e-e7cf-430d-8745-4e6934fc855c | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,861 | supabase-export-v2 | 4712455087b6230d | Usually message passing between processes is done using queues or by using :class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`.
However, the :mod:`!multiprocessing.connection` module allows some extra
flexibility. It basically gives a high level message oriented API for dealing
with sockets or Window... | trusted_official_docs | CPython Docs | Usually message passing between processes is done using queues or by using :class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`.
However, the :mod:`!multiprocessing.connection` module allows some extra
flexibility. It basically gives a high level message oriented API for dealing
with sockets or Window... | Usually message passing between processes is done using queues or by using :class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`.
However, the :mod:`!multiprocessing.connection` module allows some extra
flexibility. It basically gives a high level message oriented API for dealing
with sockets or Window... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
278b131a-7ea0-4702-b8bd-1c0e47b799f9 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,457 | supabase-export-v2 | 10523bf56ebc4574 | .. function:: set_executable(executable)
Set the path of the Python interpreter to use when starting a child process. (By default :data:`sys.executable` is used). Embedders will probably need to
do something like :: | trusted_official_docs | CPython Docs | .. function:: set_executable(executable)
Set the path of the Python interpreter to use when starting a child process. (By default :data:`sys.executable` is used). Embedders will probably need to
do something like :: | .. function:: set_executable(executable)
Set the path of the Python interpreter to use when starting a child process. (By default :data:`sys.executable` is used). Embedders will probably need to
do something like :: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
27e6f5dc-97ab-4c27-9e06-cbbcb74cffbe | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,736 | supabase-export-v2 | 167280d3de9dcd07 | import Queue >>> queue = Queue() >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue', callable=lambda:queue) >>> m = QueueManager(address=('', 50000), authkey=b'abracadabra') >>> s = m.get_server() >>> s.serve_forever()
One client can access the server as follows:: | trusted_official_docs | CPython Docs | import Queue >>> queue = Queue() >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue', callable=lambda:queue) >>> m = QueueManager(address=('', 50000), authkey=b'abracadabra') >>> s = m.get_server() >>> s.serve_forever()
One client can access the server as follows:: | import Queue >>> queue = Queue() >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue', callable=lambda:queue) >>> m = QueueManager(address=('', 50000), authkey=b'abracadabra') >>> s = m.get_server() >>> s.serve_forever()
One client can access the server as follows:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
27f148d1-08b1-43d9-a947-ce75e491253f | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,464 | supabase-export-v2 | 700636f214723243 | that their already imported state is inherited by forked processes. This can be used as a performance enhancement to avoid repeated work in every process.
For this to work, it must be called before the forkserver process has been
launched (before creating a :class:`Pool` or starting a :class:`Process`). | trusted_official_docs | CPython Docs | that their already imported state is inherited by forked processes. This can be used as a performance enhancement to avoid repeated work in every process.
For this to work, it must be called before the forkserver process has been
launched (before creating a :class:`Pool` or starting a :class:`Process`). | that their already imported state is inherited by forked processes. This can be used as a performance enhancement to avoid repeated work in every process.
For this to work, it must be called before the forkserver process has been
launched (before creating a :class:`Pool` or starting a :class:`Process`). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2a38a21c-d33d-457a-8624-3dd33672bdc0 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 7,023 | supabase-export-v2 | 6c213a3533baee8e | This allows the newly spawned Python interpreter to safely import the module and then run the module's ``foo()`` function.
Similar restrictions apply if a pool or manager is created in the main
module. | trusted_official_docs | CPython Docs | This allows the newly spawned Python interpreter to safely import the module and then run the module's ``foo()`` function.
Similar restrictions apply if a pool or manager is created in the main
module. | This allows the newly spawned Python interpreter to safely import the module and then run the module's ``foo()`` function.
Similar restrictions apply if a pool or manager is created in the main
module. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2acf5fc2-e6bb-480c-908c-13ae7b9ff83e | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,610 | supabase-export-v2 | d55b0c8e657c5959 | ctypes type or a one character typecode of the kind used by the :mod:`array` module. *\*args* is passed on to the constructor for the type.
Note that setting and getting the value is potentially non-atomic -- use
:func:`Value` instead to make sure that access is automatically synchronized
using a lock. | trusted_official_docs | CPython Docs | ctypes type or a one character typecode of the kind used by the :mod:`array` module. *\*args* is passed on to the constructor for the type.
Note that setting and getting the value is potentially non-atomic -- use
:func:`Value` instead to make sure that access is automatically synchronized
using a lock. | ctypes type or a one character typecode of the kind used by the :mod:`array` module. *\*args* is passed on to the constructor for the type.
Note that setting and getting the value is potentially non-atomic -- use
:func:`Value` instead to make sure that access is automatically synchronized
using a lock. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2b817de5-abb0-4e90-89d0-95e887043e27 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,678 | supabase-export-v2 | 65b1467af8e10fa0 | can be used to tell the server process to create a new shared object and return a proxy for it. By default it is ``True``.
:class:`BaseManager` instances also have one read-only property: | trusted_official_docs | CPython Docs | can be used to tell the server process to create a new shared object and return a proxy for it. By default it is ``True``.
:class:`BaseManager` instances also have one read-only property: | can be used to tell the server process to create a new shared object and return a proxy for it. By default it is ``True``.
:class:`BaseManager` instances also have one read-only property: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2c20ae62-0c7d-4986-94f2-8cd78ba46262 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,241 | supabase-export-v2 | 1fdbc4f81b5055bf | # evaluate "os.getpid()" asynchronously res = pool.apply_async(os.getpid, ()) # runs in *only* one process print(res.get(timeout=1)) # prints the PID of that process
# launching multiple evaluations asynchronously *may* use more processes
multiple_results = [pool.apply_async(os.getpid, ()) for i in range(4)]
print([r... | trusted_official_docs | CPython Docs | # evaluate "os.getpid()" asynchronously res = pool.apply_async(os.getpid, ()) # runs in *only* one process print(res.get(timeout=1)) # prints the PID of that process
# launching multiple evaluations asynchronously *may* use more processes
multiple_results = [pool.apply_async(os.getpid, ()) for i in range(4)]
print([r... | # evaluate "os.getpid()" asynchronously res = pool.apply_async(os.getpid, ()) # runs in *only* one process print(res.get(timeout=1)) # prints the PID of that process
# launching multiple evaluations asynchronously *may* use more processes
multiple_results = [pool.apply_async(os.getpid, ()) for i in range(4)]
print([r... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e137406-e955-48de-9b9d-18f31ab09198 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,740 | supabase-export-v2 | ff31dbe5f761e8fd | from multiprocessing.managers import BaseManager >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue') >>> m = QueueManager(address=('foo.bar.org', 50000), authkey=b'abracadabra') >>> m.connect() >>> queue = m.get_queue() >>> queue.get() 'hello'
Local processes can also access that queue, usi... | trusted_official_docs | CPython Docs | from multiprocessing.managers import BaseManager >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue') >>> m = QueueManager(address=('foo.bar.org', 50000), authkey=b'abracadabra') >>> m.connect() >>> queue = m.get_queue() >>> queue.get() 'hello'
Local processes can also access that queue, usi... | from multiprocessing.managers import BaseManager >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue') >>> m = QueueManager(address=('foo.bar.org', 50000), authkey=b'abracadabra') >>> m.connect() >>> queue = m.get_queue() >>> queue.get() 'hello'
Local processes can also access that queue, usi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e4c9117-cc4f-4724-b9f4-fc5b72ed6c13 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,560 | supabase-export-v2 | 1229d0cd82cef1c7 | Note that there are several differences in this first argument's behavior compared to the implementation of :meth:`threading.RLock.acquire`, starting with the name of the argument itself.
When invoked with the *block* argument set to ``False``, do not block. If the lock has already been acquired (and thus is owned) by ... | trusted_official_docs | CPython Docs | Note that there are several differences in this first argument's behavior compared to the implementation of :meth:`threading.RLock.acquire`, starting with the name of the argument itself.
When invoked with the *block* argument set to ``False``, do not block. If the lock has already been acquired (and thus is owned) by ... | Note that there are several differences in this first argument's behavior compared to the implementation of :meth:`threading.RLock.acquire`, starting with the name of the argument itself.
When invoked with the *block* argument set to ``False``, do not block. If the lock has already been acquired (and thus is owned) by ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e87938c-8e2b-4882-8c60-b1c3843bc4fc | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 7,022 | supabase-export-v2 | 5266150e7c92c704 | (The ``freeze_support()`` line can be omitted if the program will be run normally instead of frozen.)
This allows the newly spawned Python interpreter to safely import the module
and then run the module's ``foo()`` function. | trusted_official_docs | CPython Docs | (The ``freeze_support()`` line can be omitted if the program will be run normally instead of frozen.)
This allows the newly spawned Python interpreter to safely import the module
and then run the module's ``foo()`` function. | (The ``freeze_support()`` line can be omitted if the program will be run normally instead of frozen.)
This allows the newly spawned Python interpreter to safely import the module
and then run the module's ``foo()`` function. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e89b62c-f6d3-4d13-b226-5066def541d9 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,162 | supabase-export-v2 | 1dcd9295c3d53fde | versionchanged:: 3.14 This is no longer the default start method on any platform. Code that requires *fork* must explicitly specify that via :func:`get_context` or :func:`set_start_method`.
.. versionchanged:: 3.12
If Python is able to detect that your process has multiple threads, the
:func:`os.fork` function that t... | trusted_official_docs | CPython Docs | versionchanged:: 3.14 This is no longer the default start method on any platform. Code that requires *fork* must explicitly specify that via :func:`get_context` or :func:`set_start_method`.
.. versionchanged:: 3.12
If Python is able to detect that your process has multiple threads, the
:func:`os.fork` function that t... | versionchanged:: 3.14 This is no longer the default start method on any platform. Code that requires *fork* must explicitly specify that via :func:`get_context` or :func:`set_start_method`.
.. versionchanged:: 3.12
If Python is able to detect that your process has multiple threads, the
:func:`os.fork` function that t... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2fe157fa-aa58-4b04-b9fe-4e8fd8fc6dbc | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,413 | supabase-export-v2 | efe76f0fdf8eb5dd | consumers. For each :meth:`~Queue.get` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue that the processing on the task is complete.
If a :meth:`~queue.Queue.join` is currently blocking, it will resume when all
items have been processed (meaning that a :meth:`task_done` call was
received f... | trusted_official_docs | CPython Docs | consumers. For each :meth:`~Queue.get` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue that the processing on the task is complete.
If a :meth:`~queue.Queue.join` is currently blocking, it will resume when all
items have been processed (meaning that a :meth:`task_done` call was
received f... | consumers. For each :meth:`~Queue.get` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue that the processing on the task is complete.
If a :meth:`~queue.Queue.join` is currently blocking, it will resume when all
items have been processed (meaning that a :meth:`task_done` call was
received f... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2fe51ad2-f314-41a5-a781-28fc491d5432 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,260 | supabase-export-v2 | 9bbd687ad5bc38bf | keyword-only *daemon* argument sets the process :attr:`daemon` flag to ``True`` or ``False``. If ``None`` (the default), this flag will be inherited from the creating process.
By default, no arguments are passed to *target*. The *args* argument,
which defaults to ``()``, can be used to specify a list or tuple of the a... | trusted_official_docs | CPython Docs | keyword-only *daemon* argument sets the process :attr:`daemon` flag to ``True`` or ``False``. If ``None`` (the default), this flag will be inherited from the creating process.
By default, no arguments are passed to *target*. The *args* argument,
which defaults to ``()``, can be used to specify a list or tuple of the a... | keyword-only *daemon* argument sets the process :attr:`daemon` flag to ``True`` or ``False``. If ``None`` (the default), this flag will be inherited from the creating process.
By default, no arguments are passed to *target*. The *args* argument,
which defaults to ``()``, can be used to specify a list or tuple of the a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2ff0c2f4-bdda-42d7-acfa-cf5596b40f05 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,809 | supabase-export-v2 | ab91b091d93a7c6a | argument. When the result becomes ready *callback* is applied to it, that is unless the call failed, in which case the *error_callback* is applied instead.
If *error_callback* is specified then it should be a callable which
accepts a single argument. If the target function fails, then
the *error_callback* is called w... | trusted_official_docs | CPython Docs | argument. When the result becomes ready *callback* is applied to it, that is unless the call failed, in which case the *error_callback* is applied instead.
If *error_callback* is specified then it should be a callable which
accepts a single argument. If the target function fails, then
the *error_callback* is called w... | argument. When the result becomes ready *callback* is applied to it, that is unless the call failed, in which case the *error_callback* is applied instead.
If *error_callback* is specified then it should be a callable which
accepts a single argument. If the target function fails, then
the *error_callback* is called w... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2ff4ed12-bc5c-4feb-8023-aa465612b737 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,984 | supabase-export-v2 | a6b7d014e6d02767 | a parent process using a global resource. However, it is better to pass the object as an argument to the constructor for the child process.
Apart from making the code (potentially) compatible with Windows
and the other start methods this also ensures that as long as the
child process is still alive the object will no... | trusted_official_docs | CPython Docs | a parent process using a global resource. However, it is better to pass the object as an argument to the constructor for the child process.
Apart from making the code (potentially) compatible with Windows
and the other start methods this also ensures that as long as the
child process is still alive the object will no... | a parent process using a global resource. However, it is better to pass the object as an argument to the constructor for the child process.
Apart from making the code (potentially) compatible with Windows
and the other start methods this also ensures that as long as the
child process is still alive the object will no... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2ffa35ae-d8ff-4527-a311-c470f3e08f1a | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,921 | supabase-export-v2 | 90078ffb1bcbef43 | * An ``'AF_UNIX'`` address is a string representing a filename on the filesystem.
* An ``'AF_PIPE'`` address is a string of the form
:samp:`r'\\\\\\.\\pipe\\\\{PipeName}'`. To use :func:`Client` to connect to a named
pipe on a remote computer called *ServerName* one should use an address of the
form :samp:`r'\\\\\\\... | trusted_official_docs | CPython Docs | * An ``'AF_UNIX'`` address is a string representing a filename on the filesystem.
* An ``'AF_PIPE'`` address is a string of the form
:samp:`r'\\\\\\.\\pipe\\\\{PipeName}'`. To use :func:`Client` to connect to a named
pipe on a remote computer called *ServerName* one should use an address of the
form :samp:`r'\\\\\\\... | * An ``'AF_UNIX'`` address is a string representing a filename on the filesystem.
* An ``'AF_PIPE'`` address is a string of the form
:samp:`r'\\\\\\.\\pipe\\\\{PipeName}'`. To use :func:`Client` to connect to a named
pipe on a remote computer called *ServerName* one should use an address of the
form :samp:`r'\\\\\\\... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
31455624-de38-4a41-8d72-3133facd2f76 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,628 | supabase-export-v2 | 14947d73858bf991 | two methods in addition to those of the object it wraps: :meth:`get_obj` returns the wrapped object and :meth:`get_lock` returns the lock object used for synchronization.
Note that accessing the ctypes object through the wrapper can be a lot slower
than accessing the raw ctypes object. | trusted_official_docs | CPython Docs | two methods in addition to those of the object it wraps: :meth:`get_obj` returns the wrapped object and :meth:`get_lock` returns the lock object used for synchronization.
Note that accessing the ctypes object through the wrapper can be a lot slower
than accessing the raw ctypes object. | two methods in addition to those of the object it wraps: :meth:`get_obj` returns the wrapped object and :meth:`get_lock` returns the lock object used for synchronization.
Note that accessing the ctypes object through the wrapper can be a lot slower
than accessing the raw ctypes object. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
31d4619c-6927-47d3-a977-42afc6e7f00a | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,625 | supabase-export-v2 | 16304ee9ea84d197 | .. function:: synchronized(obj, lock=None, ctx=None)
Return a process-safe wrapper object for a ctypes object which uses *lock* to
synchronize access. If *lock* is ``None`` (the default) then a
:class:`multiprocessing.RLock` object is created automatically. | trusted_official_docs | CPython Docs | .. function:: synchronized(obj, lock=None, ctx=None)
Return a process-safe wrapper object for a ctypes object which uses *lock* to
synchronize access. If *lock* is ``None`` (the default) then a
:class:`multiprocessing.RLock` object is created automatically. | .. function:: synchronized(obj, lock=None, ctx=None)
Return a process-safe wrapper object for a ctypes object which uses *lock* to
synchronize access. If *lock* is ``None`` (the default) then a
:class:`multiprocessing.RLock` object is created automatically. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
340f6d6d-8288-4811-90f2-bb360fa11983 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,738 | supabase-export-v2 | 80e2be4be5b26efe | >>> from multiprocessing.managers import BaseManager >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue') >>> m = QueueManager(address=('foo.bar.org', 50000), authkey=b'abracadabra') >>> m.connect() >>> queue = m.get_queue() >>> queue.put('hello')
Another client can also use it:: | trusted_official_docs | CPython Docs | >>> from multiprocessing.managers import BaseManager >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue') >>> m = QueueManager(address=('foo.bar.org', 50000), authkey=b'abracadabra') >>> m.connect() >>> queue = m.get_queue() >>> queue.put('hello')
Another client can also use it:: | >>> from multiprocessing.managers import BaseManager >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue') >>> m = QueueManager(address=('foo.bar.org', 50000), authkey=b'abracadabra') >>> m.connect() >>> queue = m.get_queue() >>> queue.put('hello')
Another client can also use it:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
34829368-c48f-4820-af41-c8e576075f46 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,315 | supabase-export-v2 | 950ca0bdf96f99e7 | POSIX this is done using the :py:const:`~signal.SIGTERM` signal; on Windows :c:func:`!TerminateProcess` is used. Note that exit handlers and finally clauses, etc., will not be executed.
Note that descendant processes of the process will *not* be terminated --
they will simply become orphaned. | trusted_official_docs | CPython Docs | POSIX this is done using the :py:const:`~signal.SIGTERM` signal; on Windows :c:func:`!TerminateProcess` is used. Note that exit handlers and finally clauses, etc., will not be executed.
Note that descendant processes of the process will *not* be terminated --
they will simply become orphaned. | POSIX this is done using the :py:const:`~signal.SIGTERM` signal; on Windows :c:func:`!TerminateProcess` is used. Note that exit handlers and finally clauses, etc., will not be executed.
Note that descendant processes of the process will *not* be terminated --
they will simply become orphaned. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
371df3aa-8d32-4708-840c-7320b157072a | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,874 | supabase-export-v2 | 218495643fcbd617 | A wrapper for a bound socket or Windows named pipe which is 'listening' for connections.
*address* is the address to be used by the bound socket or named pipe of the
listener object. | trusted_official_docs | CPython Docs | A wrapper for a bound socket or Windows named pipe which is 'listening' for connections.
*address* is the address to be used by the bound socket or named pipe of the
listener object. | A wrapper for a bound socket or Windows named pipe which is 'listening' for connections.
*address* is the address to be used by the bound socket or named pipe of the
listener object. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
37213214-5826-40eb-b524-693edfac6bf3 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,452 | supabase-export-v2 | 2d48fb231612aaf6 | Return the name of start method used for starting processes.
If the global start method is not set and *allow_none* is ``False``, the global start
method is set to the default, and its name is returned. See
:ref:`global-start-method` for more details. | trusted_official_docs | CPython Docs | Return the name of start method used for starting processes.
If the global start method is not set and *allow_none* is ``False``, the global start
method is set to the default, and its name is returned. See
:ref:`global-start-method` for more details. | Return the name of start method used for starting processes.
If the global start method is not set and *allow_none* is ``False``, the global start
method is set to the default, and its name is returned. See
:ref:`global-start-method` for more details. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3761baa7-7360-41bc-a495-e2f29ce70588 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,751 | supabase-export-v2 | 7da30e7e870058aa | .. doctest::
>>> a = manager.list()
>>> b = manager.list()
>>> a.append(b) # referent of a now contains referent of b
>>> print(a, b)
[<ListProxy object, typeid 'list' at ...>] []
>>> b.append('hello')
>>> print(a[0], b)
['hello'] ['hello'] | trusted_official_docs | CPython Docs | .. doctest::
>>> a = manager.list()
>>> b = manager.list()
>>> a.append(b) # referent of a now contains referent of b
>>> print(a, b)
[<ListProxy object, typeid 'list' at ...>] []
>>> b.append('hello')
>>> print(a[0], b)
['hello'] ['hello'] | .. doctest::
>>> a = manager.list()
>>> b = manager.list()
>>> a.append(b) # referent of a now contains referent of b
>>> print(a, b)
[<ListProxy object, typeid 'list' at ...>] []
>>> b.append('hello')
>>> print(a[0], b)
['hello'] ['hello'] | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
381c0e85-3023-40be-959f-79041056ae41 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,564 | supabase-export-v2 | 02b9a48686e7d7b6 | 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 the lock. An :exc:`AssertionError` is raised if this method is called by a process
or thread other than the own... | trusted_official_docs | CPython Docs | 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 the lock. An :exc:`AssertionError` is raised if this method is called by a process
or thread other than the own... | 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 the lock. An :exc:`AssertionError` is raised if this method is called by a process
or thread other than the own... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
383db35f-663d-458b-af88-185aed7fcd99 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,805 | supabase-export-v2 | 452f43739bcf9efb | .. method:: apply(func[, args[, kwds]])
Call *func* with arguments *args* and keyword arguments *kwds*. It blocks
until the result is ready. Given this blocks, :meth:`apply_async` is
better suited for performing work in parallel. Additionally, *func*
is only executed in one of the workers of the pool. | trusted_official_docs | CPython Docs | .. method:: apply(func[, args[, kwds]])
Call *func* with arguments *args* and keyword arguments *kwds*. It blocks
until the result is ready. Given this blocks, :meth:`apply_async` is
better suited for performing work in parallel. Additionally, *func*
is only executed in one of the workers of the pool. | .. method:: apply(func[, args[, kwds]])
Call *func* with arguments *args* and keyword arguments *kwds*. It blocks
until the result is ready. Given this blocks, :meth:`apply_async` is
better suited for performing work in parallel. Additionally, *func*
is only executed in one of the workers of the pool. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
38cea764-75aa-49f4-a82a-3548e582983e | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,263 | supabase-export-v2 | 9c8aa0b2579db700 | .. note::
In general, all arguments to :class:`Process` must be picklable. This is
frequently observed when trying to create a :class:`Process` or use a
:class:`concurrent.futures.ProcessPoolExecutor` from a REPL with a
locally defined *target* function. | trusted_official_docs | CPython Docs | .. note::
In general, all arguments to :class:`Process` must be picklable. This is
frequently observed when trying to create a :class:`Process` or use a
:class:`concurrent.futures.ProcessPoolExecutor` from a REPL with a
locally defined *target* function. | .. note::
In general, all arguments to :class:`Process` must be picklable. This is
frequently observed when trying to create a :class:`Process` or use a
:class:`concurrent.futures.ProcessPoolExecutor` from a REPL with a
locally defined *target* function. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
393ef707-c6ae-4704-93f5-313e3a28f668 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,539 | supabase-export-v2 | 957781664d579640 | and behaviors of :class:`threading.Lock` as it applies to threads are replicated here in :class:`multiprocessing.Lock` as it applies to either processes or threads, except as noted.
Note that :class:`Lock` is actually a factory function which returns an
instance of ``multiprocessing.synchronize.Lock`` initialized with... | trusted_official_docs | CPython Docs | and behaviors of :class:`threading.Lock` as it applies to threads are replicated here in :class:`multiprocessing.Lock` as it applies to either processes or threads, except as noted.
Note that :class:`Lock` is actually a factory function which returns an
instance of ``multiprocessing.synchronize.Lock`` initialized with... | and behaviors of :class:`threading.Lock` as it applies to threads are replicated here in :class:`multiprocessing.Lock` as it applies to either processes or threads, except as noted.
Note that :class:`Lock` is actually a factory function which returns an
instance of ``multiprocessing.synchronize.Lock`` initialized with... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
39b752be-b396-4fd7-9745-da1f7d2387a4 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,618 | supabase-export-v2 | 38a3f71dfefff4de | .. function:: Value(typecode_or_type, *args, lock=True, ctx=None)
The same as :func:`RawValue` except that depending on the value of *lock* a
process-safe synchronization wrapper may be returned instead of a raw ctypes
object. | trusted_official_docs | CPython Docs | .. function:: Value(typecode_or_type, *args, lock=True, ctx=None)
The same as :func:`RawValue` except that depending on the value of *lock* a
process-safe synchronization wrapper may be returned instead of a raw ctypes
object. | .. function:: Value(typecode_or_type, *args, lock=True, ctx=None)
The same as :func:`RawValue` except that depending on the value of *lock* a
process-safe synchronization wrapper may be returned instead of a raw ctypes
object. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
39fffa7c-024c-4982-a321-a7660dfe04d2 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,425 | supabase-export-v2 | 5fd7442901a2a7f3 | is not equivalent to the number of CPUs the current process can use. The number of usable CPUs can be obtained with :func:`os.process_cpu_count` (or ``len(os.sched_getaffinity(0))``).
When the number of CPUs cannot be determined a :exc:`NotImplementedError`
is raised. | trusted_official_docs | CPython Docs | is not equivalent to the number of CPUs the current process can use. The number of usable CPUs can be obtained with :func:`os.process_cpu_count` (or ``len(os.sched_getaffinity(0))``).
When the number of CPUs cannot be determined a :exc:`NotImplementedError`
is raised. | is not equivalent to the number of CPUs the current process can use. The number of usable CPUs can be obtained with :func:`os.process_cpu_count` (or ``len(os.sched_getaffinity(0))``).
When the number of CPUs cannot be determined a :exc:`NotImplementedError`
is raised. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3b30e5a8-93e4-4243-b7ef-e6ab10871df4 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,626 | supabase-export-v2 | 1f10545b13960985 | wrapper object for a ctypes object which uses *lock* to synchronize access. If *lock* is ``None`` (the default) then a :class:`multiprocessing.RLock` object is created automatically.
*ctx* is a context object, or ``None`` (use the current context). If ``None``,
calling this may set the global start method. See
:ref:`... | trusted_official_docs | CPython Docs | wrapper object for a ctypes object which uses *lock* to synchronize access. If *lock* is ``None`` (the default) then a :class:`multiprocessing.RLock` object is created automatically.
*ctx* is a context object, or ``None`` (use the current context). If ``None``,
calling this may set the global start method. See
:ref:`... | wrapper object for a ctypes object which uses *lock* to synchronize access. If *lock* is ``None`` (the default) then a :class:`multiprocessing.RLock` object is created automatically.
*ctx* is a context object, or ``None`` (use the current context). If ``None``,
calling this may set the global start method. See
:ref:`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3b4296e1-4148-4527-8733-b196717c0928 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,881 | supabase-export-v2 | a766990f20be6dc7 | .. method:: accept()
Accept a connection on the bound socket or named pipe of the listener
object and return a :class:`~Connection` object. If authentication is attempted and fails, then
:exc:`~multiprocessing.AuthenticationError` is raised. | trusted_official_docs | CPython Docs | .. method:: accept()
Accept a connection on the bound socket or named pipe of the listener
object and return a :class:`~Connection` object. If authentication is attempted and fails, then
:exc:`~multiprocessing.AuthenticationError` is raised. | .. method:: accept()
Accept a connection on the bound socket or named pipe of the listener
object and return a :class:`~Connection` object. If authentication is attempted and fails, then
:exc:`~multiprocessing.AuthenticationError` is raised. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3b5d0962-6cf3-4570-8f4b-8a95ce6c4b05 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,682 | supabase-export-v2 | 9c72566c0bab1195 | management protocol -- see :ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server process (if it has not already started) and then returns the manager object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`.
In previous versions :meth:`~contextmanager.__enter__` did not start the
manage... | trusted_official_docs | CPython Docs | management protocol -- see :ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server process (if it has not already started) and then returns the manager object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`.
In previous versions :meth:`~contextmanager.__enter__` did not start the
manage... | management protocol -- see :ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server process (if it has not already started) and then returns the manager object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`.
In previous versions :meth:`~contextmanager.__enter__` did not start the
manage... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3ba4f939-63cc-4e89-8e8e-c5ce961442fa | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,891 | supabase-export-v2 | 8ac1a25b01793998 | .. function:: wait(object_list, timeout=None)
Wait till an object in *object_list* is ready. Returns the list of
those objects in *object_list* which are ready. If *timeout* is a
float then the call blocks for at most that many seconds. If
*timeout* is ``None`` then it will block for an unlimited period. A negative ... | trusted_official_docs | CPython Docs | .. function:: wait(object_list, timeout=None)
Wait till an object in *object_list* is ready. Returns the list of
those objects in *object_list* which are ready. If *timeout* is a
float then the call blocks for at most that many seconds. If
*timeout* is ``None`` then it will block for an unlimited period. A negative ... | .. function:: wait(object_list, timeout=None)
Wait till an object in *object_list* is ready. Returns the list of
those objects in *object_list* which are ready. If *timeout* is a
float then the call blocks for at most that many seconds. If
*timeout* is ``None`` then it will block for an unlimited period. A negative ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3bc9504f-6718-4387-b9fd-bb5d0765777b | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,466 | supabase-export-v2 | 8c704510a70e7b74 | to stderr, and ``"fail"`` causes the forkserver subprocess to exit with the exception traceback on stderr, making subsequent process creation fail with :exc:`EOFError` or :exc:`ConnectionError`.
Only meaningful when using the ``'forkserver'`` start method. See :ref:`multiprocessing-start-methods`. | trusted_official_docs | CPython Docs | to stderr, and ``"fail"`` causes the forkserver subprocess to exit with the exception traceback on stderr, making subsequent process creation fail with :exc:`EOFError` or :exc:`ConnectionError`.
Only meaningful when using the ``'forkserver'`` start method. See :ref:`multiprocessing-start-methods`. | to stderr, and ``"fail"`` causes the forkserver subprocess to exit with the exception traceback on stderr, making subsequent process creation fail with :exc:`EOFError` or :exc:`ConnectionError`.
Only meaningful when using the ``'forkserver'`` start method. See :ref:`multiprocessing-start-methods`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3befd903-9e7f-4274-bab4-531db7294356 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,326 | supabase-export-v2 | f2d500c82b1a0e81 | .. doctest::
>>> import multiprocessing, time, signal
>>> mp_context = multiprocessing.get_context('spawn')
>>> p = mp_context.Process(target=time.sleep, args=(1000,))
>>> print(p, p.is_alive())
<...Process ... initial> False
>>> p.start()
>>> print(p, p.is_alive())
<...Process ... started> True
>>> p.terminate... | trusted_official_docs | CPython Docs | .. doctest::
>>> import multiprocessing, time, signal
>>> mp_context = multiprocessing.get_context('spawn')
>>> p = mp_context.Process(target=time.sleep, args=(1000,))
>>> print(p, p.is_alive())
<...Process ... initial> False
>>> p.start()
>>> print(p, p.is_alive())
<...Process ... started> True
>>> p.terminate... | .. doctest::
>>> import multiprocessing, time, signal
>>> mp_context = multiprocessing.get_context('spawn')
>>> p = mp_context.Process(target=time.sleep, args=(1000,))
>>> print(p, p.is_alive())
<...Process ... initial> False
>>> p.start()
>>> print(p, p.is_alive())
<...Process ... started> True
>>> p.terminate... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3c5a4f6d-6b38-4c02-a551-dc846dd664a6 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,166 | supabase-export-v2 | 393404c73f3edfd1 | Available on POSIX platforms which support passing file descriptors over Unix pipes such as Linux. The default on those.
.. versionchanged:: 3.14
This became the default start method on POSIX platforms. | trusted_official_docs | CPython Docs | Available on POSIX platforms which support passing file descriptors over Unix pipes such as Linux. The default on those.
.. versionchanged:: 3.14
This became the default start method on POSIX platforms. | Available on POSIX platforms which support passing file descriptors over Unix pipes such as Linux. The default on those.
.. versionchanged:: 3.14
This became the default start method on POSIX platforms. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3cfe887d-b9cd-4bce-b71b-5eb687272f5b | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,773 | supabase-export-v2 | b18dd9b5f7954053 | by :meth:`_callmethod`. If some other exception is raised in the manager's process then this is converted into a :exc:`RemoteError` exception and is raised by :meth:`_callmethod`.
Note in particular that an exception will be raised if *methodname* has
not been *exposed*. | trusted_official_docs | CPython Docs | by :meth:`_callmethod`. If some other exception is raised in the manager's process then this is converted into a :exc:`RemoteError` exception and is raised by :meth:`_callmethod`.
Note in particular that an exception will be raised if *methodname* has
not been *exposed*. | by :meth:`_callmethod`. If some other exception is raised in the manager's process then this is converted into a :exc:`RemoteError` exception and is raised by :meth:`_callmethod`.
Note in particular that an exception will be raised if *methodname* has
not been *exposed*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3d47ef63-8c85-4d3e-a956-b89c83730457 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,271 | supabase-export-v2 | 6fd47eab605b2590 | Method representing the process's activity.
You may override this method in a subclass. The standard :meth:`run`
method invokes the callable object passed to the object's constructor as
the target argument, if any, with sequential and keyword arguments taken
from the *args* and *kwargs* arguments, respectively. | trusted_official_docs | CPython Docs | Method representing the process's activity.
You may override this method in a subclass. The standard :meth:`run`
method invokes the callable object passed to the object's constructor as
the target argument, if any, with sequential and keyword arguments taken
from the *args* and *kwargs* arguments, respectively. | Method representing the process's activity.
You may override this method in a subclass. The standard :meth:`run`
method invokes the callable object passed to the object's constructor as
the target argument, if any, with sequential and keyword arguments taken
from the *args* and *kwargs* arguments, respectively. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3e020276-0da2-421a-a473-3b6b0cab3a90 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,936 | supabase-export-v2 | 4322805c62b8727e | 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.
.. currentmodule:: multiprocessing
.. function:: log_to_stderr(level=None) | trusted_official_docs | CPython Docs | 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.
.. currentmodule:: multiprocessing
.. function:: log_to_stderr(level=None) | 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.
.. currentmodule:: multiprocessing
.. function:: log_to_stderr(level=None) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3e895d18-9dcc-47ba-832e-60d457f65c59 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,470 | supabase-export-v2 | 658198c5f622d508 | .. function:: set_start_method(method, force=False)
Set the method which should be used to start child processes. The *method* argument can be ``'fork'``, ``'spawn'`` or ``'forkserver'``. Raises :exc:`RuntimeError` if the start method has already been set and *force*
is not ``True``. If *method* is ``None`` and *force... | trusted_official_docs | CPython Docs | .. function:: set_start_method(method, force=False)
Set the method which should be used to start child processes. The *method* argument can be ``'fork'``, ``'spawn'`` or ``'forkserver'``. Raises :exc:`RuntimeError` if the start method has already been set and *force*
is not ``True``. If *method* is ``None`` and *force... | .. function:: set_start_method(method, force=False)
Set the method which should be used to start child processes. The *method* argument can be ``'fork'``, ``'spawn'`` or ``'forkserver'``. Raises :exc:`RuntimeError` if the start method has already been set and *force*
is not ``True``. If *method* is ``None`` and *force... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3ea3756a-5d60-4443-82d3-4ef0e9918277 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,842 | supabase-export-v2 | f6a8ebaa67b9fc72 | .. method:: get([timeout])
Return the result when it arrives. If *timeout* is not ``None`` and the
result does not arrive within *timeout* seconds then
:exc:`multiprocessing.TimeoutError` is raised. If the remote call raised
an exception then that exception will be reraised by :meth:`get`. | trusted_official_docs | CPython Docs | .. method:: get([timeout])
Return the result when it arrives. If *timeout* is not ``None`` and the
result does not arrive within *timeout* seconds then
:exc:`multiprocessing.TimeoutError` is raised. If the remote call raised
an exception then that exception will be reraised by :meth:`get`. | .. method:: get([timeout])
Return the result when it arrives. If *timeout* is not ``None`` and the
result does not arrive within *timeout* seconds then
:exc:`multiprocessing.TimeoutError` is raised. If the remote call raised
an exception then that exception will be reraised by :meth:`get`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3f21b346-4766-4326-8c0c-327842d1976d | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,483 | supabase-export-v2 | c5aa4890346b2455 | .. method:: recv()
Return an object sent from the other end of the connection using
:meth:`send`. Blocks until there is something to receive. Raises
:exc:`EOFError` if there is nothing left to receive
and the other end was closed. | trusted_official_docs | CPython Docs | .. method:: recv()
Return an object sent from the other end of the connection using
:meth:`send`. Blocks until there is something to receive. Raises
:exc:`EOFError` if there is nothing left to receive
and the other end was closed. | .. method:: recv()
Return an object sent from the other end of the connection using
:meth:`send`. Blocks until there is something to receive. Raises
:exc:`EOFError` if there is nothing left to receive
and the other end was closed. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3fd5eb94-6889-434b-80f6-d7ba97affac3 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,828 | supabase-export-v2 | ba65da8ad1e2e2bf | Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the *iterable* are expected to be iterables that are unpacked as arguments.
Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2),
func(3,4)]``. | trusted_official_docs | CPython Docs | Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the *iterable* are expected to be iterables that are unpacked as arguments.
Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2),
func(3,4)]``. | Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the *iterable* are expected to be iterables that are unpacked as arguments.
Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2),
func(3,4)]``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
40f5d089-3b3e-4d35-b848-8cf6b9f88748 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,648 | supabase-export-v2 | 1df55274b39c9cb7 | .. module:: multiprocessing.managers :synopsis: Share data between process with shared objects.
Manager processes will be shutdown as soon as they are garbage collected or
their parent process exits. The manager classes are defined in the
:mod:`multiprocessing.managers` module: | trusted_official_docs | CPython Docs | .. module:: multiprocessing.managers :synopsis: Share data between process with shared objects.
Manager processes will be shutdown as soon as they are garbage collected or
their parent process exits. The manager classes are defined in the
:mod:`multiprocessing.managers` module: | .. module:: multiprocessing.managers :synopsis: Share data between process with shared objects.
Manager processes will be shutdown as soon as they are garbage collected or
their parent process exits. The manager classes are defined in the
:mod:`multiprocessing.managers` module: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4130122a-0b96-4d00-b4ca-08bed4d00a94 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,247 | supabase-export-v2 | 0f6969e898bc6dcb | .. note::
Functionality within this package requires that the ``__main__`` module be
importable by the children. This is covered in :ref:`multiprocessing-programming`
however it is worth pointing out here. This means that some examples, such
as the :class:`multiprocessing.pool.Pool` examples will not work in the
in... | trusted_official_docs | CPython Docs | .. note::
Functionality within this package requires that the ``__main__`` module be
importable by the children. This is covered in :ref:`multiprocessing-programming`
however it is worth pointing out here. This means that some examples, such
as the :class:`multiprocessing.pool.Pool` examples will not work in the
in... | .. note::
Functionality within this package requires that the ``__main__`` module be
importable by the children. This is covered in :ref:`multiprocessing-programming`
however it is worth pointing out here. This means that some examples, such
as the :class:`multiprocessing.pool.Pool` examples will not work in the
in... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
43c0d01f-c4d9-46c1-9754-8ec5d173c343 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,226 | supabase-export-v2 | 4ccac3ef9ac9a4a8 | def f(d, l, s): d[1] = '1' d['2'] = 2 d[0.25] = None l.reverse() s.add('a') s.add('b')
if __name__ == '__main__':
with Manager() as manager:
d = manager.dict()
l = manager.list(range(10))
s = manager.set() | trusted_official_docs | CPython Docs | def f(d, l, s): d[1] = '1' d['2'] = 2 d[0.25] = None l.reverse() s.add('a') s.add('b')
if __name__ == '__main__':
with Manager() as manager:
d = manager.dict()
l = manager.list(range(10))
s = manager.set() | def f(d, l, s): d[1] = '1' d['2'] = 2 d[0.25] = None l.reverse() s.add('a') s.add('b')
if __name__ == '__main__':
with Manager() as manager:
d = manager.dict()
l = manager.list(range(10))
s = manager.set() | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
443365fa-b0b5-4046-a315-d088575ecd7d | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,481 | supabase-export-v2 | 1a6c72fed79bba51 | Send an object to the other end of the connection which should be read using :meth:`recv`.
The object must be picklable. Very large pickles (approximately 32 MiB+,
though it depends on the OS) may raise a :exc:`ValueError` exception. | trusted_official_docs | CPython Docs | Send an object to the other end of the connection which should be read using :meth:`recv`.
The object must be picklable. Very large pickles (approximately 32 MiB+,
though it depends on the OS) may raise a :exc:`ValueError` exception. | Send an object to the other end of the connection which should be read using :meth:`recv`.
The object must be picklable. Very large pickles (approximately 32 MiB+,
though it depends on the OS) may raise a :exc:`ValueError` exception. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
44d54cca-45f8-4f97-9b84-0e2f2886fe46 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,927 | supabase-export-v2 | f28aebc7bd79ec6e | that the other knows the authentication key. (Demonstrating that both ends are using the same key does **not** involve sending the key over the connection.)
If authentication is requested but no authentication key is specified then the
return value of ``current_process().authkey`` is used (see
:class:`~multiprocessing.... | trusted_official_docs | CPython Docs | that the other knows the authentication key. (Demonstrating that both ends are using the same key does **not** involve sending the key over the connection.)
If authentication is requested but no authentication key is specified then the
return value of ``current_process().authkey`` is used (see
:class:`~multiprocessing.... | that the other knows the authentication key. (Demonstrating that both ends are using the same key does **not** involve sending the key over the connection.)
If authentication is requested but no authentication key is specified then the
return value of ``current_process().authkey`` is used (see
:class:`~multiprocessing.... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
470762cf-354e-4bdf-ba9e-98f8bafefe61 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,999 | supabase-export-v2 | e65da5360f5cb0e3 | multiple processes call :meth:`~io.IOBase.close` on this file-like object, it could result in the same data being flushed to the object multiple times, resulting in corruption.
If you write a file-like object and implement your own caching, you can
make it fork-safe by storing the pid whenever you append to the cache,... | trusted_official_docs | CPython Docs | multiple processes call :meth:`~io.IOBase.close` on this file-like object, it could result in the same data being flushed to the object multiple times, resulting in corruption.
If you write a file-like object and implement your own caching, you can
make it fork-safe by storing the pid whenever you append to the cache,... | multiple processes call :meth:`~io.IOBase.close` on this file-like object, it could result in the same data being flushed to the object multiple times, resulting in corruption.
If you write a file-like object and implement your own caching, you can
make it fork-safe by storing the pid whenever you append to the cache,... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
48cd815c-4c69-462b-bb78-d5ddd66cbc9a | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,635 | supabase-export-v2 | 10da3913fb5b19d7 | class Point(Structure): _fields_ = [('x', c_double), ('y', c_double)]
def modify(n, x, s, A):
n.value **= 2
x.value **= 2
s.value = s.value.upper()
for a in A:
a.x **= 2
a.y **= 2 | trusted_official_docs | CPython Docs | class Point(Structure): _fields_ = [('x', c_double), ('y', c_double)]
def modify(n, x, s, A):
n.value **= 2
x.value **= 2
s.value = s.value.upper()
for a in A:
a.x **= 2
a.y **= 2 | class Point(Structure): _fields_ = [('x', c_double), ('y', c_double)]
def modify(n, x, s, A):
n.value **= 2
x.value **= 2
s.value = s.value.upper()
for a in A:
a.x **= 2
a.y **= 2 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
492acc56-794f-48bc-b21a-939fbbcd44cb | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,502 | supabase-export-v2 | bf846954d2d17603 | the message will be written into the buffer from that position. Offset must be a non-negative integer less than the length of *buf* (in bytes).
If the buffer is too short then a :exc:`BufferTooShort` exception is
raised and the complete message is available as ``e.args[0]`` where ``e``
is the exception instance. | trusted_official_docs | CPython Docs | the message will be written into the buffer from that position. Offset must be a non-negative integer less than the length of *buf* (in bytes).
If the buffer is too short then a :exc:`BufferTooShort` exception is
raised and the complete message is available as ``e.args[0]`` where ``e``
is the exception instance. | the message will be written into the buffer from that position. Offset must be a non-negative integer less than the length of *buf* (in bytes).
If the buffer is too short then a :exc:`BufferTooShort` exception is
raised and the complete message is available as ``e.args[0]`` where ``e``
is the exception instance. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
49af379f-7722-4db3-b33a-4631051be227 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,817 | supabase-export-v2 | eb90cf1c1f35360e | A variant of the :meth:`.map` method which returns a :class:`~multiprocessing.pool.AsyncResult` object.
If *callback* is specified then it should be a callable which accepts a
single argument. When the result becomes ready *callback* is applied to
it, that is unless the call failed, in which case the *error_callback*... | trusted_official_docs | CPython Docs | A variant of the :meth:`.map` method which returns a :class:`~multiprocessing.pool.AsyncResult` object.
If *callback* is specified then it should be a callable which accepts a
single argument. When the result becomes ready *callback* is applied to
it, that is unless the call failed, in which case the *error_callback*... | A variant of the :meth:`.map` method which returns a :class:`~multiprocessing.pool.AsyncResult` object.
If *callback* is specified then it should be a callable which accepts a
single argument. When the result becomes ready *callback* is applied to
it, that is unless the call failed, in which case the *error_callback*... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4aa53328-0ffb-4126-8a7b-af043b2de7c3 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,615 | supabase-export-v2 | 41468f8b9a60a139 | If *lock* is ``False`` then access to the returned object will not be automatically protected by a lock, so it will not necessarily be "process-safe".
*ctx* is a context object, or ``None`` (use the current context). If ``None``,
calling this may set the global start method. See
:ref:`global-start-method` for more de... | trusted_official_docs | CPython Docs | If *lock* is ``False`` then access to the returned object will not be automatically protected by a lock, so it will not necessarily be "process-safe".
*ctx* is a context object, or ``None`` (use the current context). If ``None``,
calling this may set the global start method. See
:ref:`global-start-method` for more de... | If *lock* is ``False`` then access to the returned object will not be automatically protected by a lock, so it will not necessarily be "process-safe".
*ctx* is a context object, or ``None`` (use the current context). If ``None``,
calling this may set the global start method. See
:ref:`global-start-method` for more de... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4b51cb7d-8054-43ea-bda8-36faf1c28730 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,283 | supabase-export-v2 | d42b352f7a499de0 | The process's name. The name is a string used for identification purposes only. It has no semantics. Multiple processes may be given the same name.
The initial name is set by the constructor. If no explicit name is
provided to the constructor, a name of the form
'Process-N\ :sub:`1`:N\ :sub:`2`:...:N\ :sub:`k`' is co... | trusted_official_docs | CPython Docs | The process's name. The name is a string used for identification purposes only. It has no semantics. Multiple processes may be given the same name.
The initial name is set by the constructor. If no explicit name is
provided to the constructor, a name of the form
'Process-N\ :sub:`1`:N\ :sub:`2`:...:N\ :sub:`k`' is co... | The process's name. The name is a string used for identification purposes only. It has no semantics. Multiple processes may be given the same name.
The initial name is set by the constructor. If no explicit name is
provided to the constructor, a name of the form
'Process-N\ :sub:`1`:N\ :sub:`2`:...:N\ :sub:`k`' is co... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4babf7c7-72fd-4616-86b4-1b4d6364048e | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,744 | supabase-export-v2 | e0814e26eadf126c | Proxy Objects ^^^^^^^^^^^^^
A proxy is an object which *refers* to a shared object which lives (presumably)
in a different process. The shared object is said to be the *referent* of the
proxy. Multiple proxy objects may have the same referent. | trusted_official_docs | CPython Docs | Proxy Objects ^^^^^^^^^^^^^
A proxy is an object which *refers* to a shared object which lives (presumably)
in a different process. The shared object is said to be the *referent* of the
proxy. Multiple proxy objects may have the same referent. | Proxy Objects ^^^^^^^^^^^^^
A proxy is an object which *refers* to a shared object which lives (presumably)
in a different process. The shared object is said to be the *referent* of the
proxy. Multiple proxy objects may have the same referent. | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.