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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
96085cc4-24c0-4a46-839a-52c0354722b1 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,490 | supabase-export-v2 | 669a9077dd06e6dd | Return whether there is any data available to be read.
If *timeout* is not specified then it will return immediately. If
*timeout* is a number then this specifies the maximum time in seconds to
block. If *timeout* is ``None`` then an infinite timeout is used. | trusted_official_docs | CPython Docs | Return whether there is any data available to be read.
If *timeout* is not specified then it will return immediately. If
*timeout* is a number then this specifies the maximum time in seconds to
block. If *timeout* is ``None`` then an infinite timeout is used. | Return whether there is any data available to be read.
If *timeout* is not specified then it will return immediately. If
*timeout* is a number then this specifies the maximum time in seconds to
block. If *timeout* is ``None`` then an infinite timeout is used. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
96abdb47-bd5f-4d3b-b5be-a0aef1631256 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,872 | supabase-export-v2 | 64015c158b33c0e8 | as the secret key for an HMAC-based authentication challenge. No authentication is done if *authkey* is ``None``. :exc:`~multiprocessing.AuthenticationError` is raised if authentication fails. See :ref:`multiprocessing-auth-keys`.
.. class:: Listener([address[, family[, backlog[, authkey]]]]) | trusted_official_docs | CPython Docs | as the secret key for an HMAC-based authentication challenge. No authentication is done if *authkey* is ``None``. :exc:`~multiprocessing.AuthenticationError` is raised if authentication fails. See :ref:`multiprocessing-auth-keys`.
.. class:: Listener([address[, family[, backlog[, authkey]]]]) | as the secret key for an HMAC-based authentication challenge. No authentication is done if *authkey* is ``None``. :exc:`~multiprocessing.AuthenticationError` is raised if authentication fails. See :ref:`multiprocessing-auth-keys`.
.. class:: Listener([address[, family[, backlog[, authkey]]]]) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
99af54ad-c1a1-4834-83bb-b296bda3f268 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,223 | supabase-export-v2 | 17d5abaf9779af1d | A manager object returned by :func:`Manager` controls a server process which holds Python objects and allows other processes to manipulate them using proxies.
A manager returned by :func:`Manager` will support types
:class:`list`, :class:`dict`, :class:`set`, :class:`~managers.Namespace`, :class:`Lock`,
:class:`RLock... | trusted_official_docs | CPython Docs | A manager object returned by :func:`Manager` controls a server process which holds Python objects and allows other processes to manipulate them using proxies.
A manager returned by :func:`Manager` will support types
:class:`list`, :class:`dict`, :class:`set`, :class:`~managers.Namespace`, :class:`Lock`,
:class:`RLock... | A manager object returned by :func:`Manager` controls a server process which holds Python objects and allows other processes to manipulate them using proxies.
A manager returned by :func:`Manager` will support types
:class:`list`, :class:`dict`, :class:`set`, :class:`~managers.Namespace`, :class:`Lock`,
:class:`RLock... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9a1b18f6-f676-46b0-beb2-17ee1d72786f | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,646 | supabase-export-v2 | 31fd53ddfc624b88 | .. function:: multiprocessing.Manager() :module:
Returns a started :class:`~multiprocessing.managers.SyncManager` object which
can be used for sharing objects between processes. The returned manager
object corresponds to a spawned child process and has methods which will
create shared objects and return correspondin... | trusted_official_docs | CPython Docs | .. function:: multiprocessing.Manager() :module:
Returns a started :class:`~multiprocessing.managers.SyncManager` object which
can be used for sharing objects between processes. The returned manager
object corresponds to a spawned child process and has methods which will
create shared objects and return correspondin... | .. function:: multiprocessing.Manager() :module:
Returns a started :class:`~multiprocessing.managers.SyncManager` object which
can be used for sharing objects between processes. The returned manager
object corresponds to a spawned child process and has methods which will
create shared objects and return correspondin... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9a373e1c-6626-44e3-95d8-b3ede4aacfef | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,424 | supabase-export-v2 | 633c1cb60096555a | Return the number of CPUs in the system.
This number 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))``). | trusted_official_docs | CPython Docs | Return the number of CPUs in the system.
This number 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))``). | Return the number of CPUs in the system.
This number 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))``). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9b3fe364-521d-42fe-9e32-3c0b60af80f7 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,655 | supabase-export-v2 | 27f2b2369ed8d809 | *serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or ``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization).
*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 details. | trusted_official_docs | CPython Docs | *serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or ``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization).
*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 details. | *serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or ``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization).
*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 details. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9b477255-a476-4048-b5b1-078be56fde65 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,546 | supabase-export-v2 | 88958adc7181d6af | does not block. If the lock is currently in a locked state, return ``False``; otherwise set the lock to a locked state and return ``True``.
When invoked with a positive, floating-point value for *timeout*, block
for at most the number of seconds specified by *timeout* as long as
the lock can not be acquired. Invocati... | trusted_official_docs | CPython Docs | does not block. If the lock is currently in a locked state, return ``False``; otherwise set the lock to a locked state and return ``True``.
When invoked with a positive, floating-point value for *timeout*, block
for at most the number of seconds specified by *timeout* as long as
the lock can not be acquired. Invocati... | does not block. If the lock is currently in a locked state, return ``False``; otherwise set the lock to a locked state and return ``True``.
When invoked with a positive, floating-point value for *timeout*, block
for at most the number of seconds specified by *timeout* as long as
the lock can not be acquired. Invocati... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9bb668b7-3feb-4153-a49a-12191b48be03 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,613 | supabase-export-v2 | 5cc97f03150837f3 | .. function:: Array(typecode_or_type, size_or_initializer, *, lock=True, ctx=None)
The same as :func:`RawArray` except that depending on the value of *lock* a
process-safe synchronization wrapper may be returned instead of a raw ctypes
array. | trusted_official_docs | CPython Docs | .. function:: Array(typecode_or_type, size_or_initializer, *, lock=True, ctx=None)
The same as :func:`RawArray` except that depending on the value of *lock* a
process-safe synchronization wrapper may be returned instead of a raw ctypes
array. | .. function:: Array(typecode_or_type, size_or_initializer, *, lock=True, ctx=None)
The same as :func:`RawArray` except that depending on the value of *lock* a
process-safe synchronization wrapper may be returned instead of a raw ctypes
array. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9d437d5f-d24c-4eda-bf93-158723573772 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,889 | supabase-export-v2 | ae88eb1e6ee598ff | The address from which the last accepted connection came. If this is unavailable then it is ``None``.
.. versionchanged:: 3.3
Listener objects now support the context management protocol -- see
:ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the
listener object, and :meth:`~contextmanager.__exit... | trusted_official_docs | CPython Docs | The address from which the last accepted connection came. If this is unavailable then it is ``None``.
.. versionchanged:: 3.3
Listener objects now support the context management protocol -- see
:ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the
listener object, and :meth:`~contextmanager.__exit... | The address from which the last accepted connection came. If this is unavailable then it is ``None``.
.. versionchanged:: 3.3
Listener objects now support the context management protocol -- see
:ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the
listener object, and :meth:`~contextmanager.__exit... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9daad147-a02d-4da8-80e6-40dad3ae6069 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,895 | supabase-export-v2 | 4ba635db9c7bc01f | A connection or socket object is ready when there is data available to be read from it, or the other end has been closed.
**POSIX**: ``wait(object_list, timeout)`` almost equivalent
``select.select(object_list, [], [], timeout)``. The difference is
that, if :func:`select.select` is interrupted by a signal, it can
ra... | trusted_official_docs | CPython Docs | A connection or socket object is ready when there is data available to be read from it, or the other end has been closed.
**POSIX**: ``wait(object_list, timeout)`` almost equivalent
``select.select(object_list, [], [], timeout)``. The difference is
that, if :func:`select.select` is interrupted by a signal, it can
ra... | A connection or socket object is ready when there is data available to be read from it, or the other end has been closed.
**POSIX**: ``wait(object_list, timeout)`` almost equivalent
``select.select(object_list, [], [], timeout)``. The difference is
that, if :func:`select.select` is interrupted by a signal, it can
ra... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9f83afc4-e4d8-40a3-af18-3a045e661bae | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,594 | supabase-export-v2 | e56f5b3f8b32e53f | Return a ctypes array allocated from shared memory. By default the return value is actually a synchronized wrapper for the array.
*typecode_or_type* determines the type of the elements of the returned array:
it is either a :ref:`ctypes type <ctypes-fundamental-data-types>` or a one
character typecode of the kind used... | trusted_official_docs | CPython Docs | Return a ctypes array allocated from shared memory. By default the return value is actually a synchronized wrapper for the array.
*typecode_or_type* determines the type of the elements of the returned array:
it is either a :ref:`ctypes type <ctypes-fundamental-data-types>` or a one
character typecode of the kind used... | Return a ctypes array allocated from shared memory. By default the return value is actually a synchronized wrapper for the array.
*typecode_or_type* determines the type of the elements of the returned array:
it is either a :ref:`ctypes type <ctypes-fundamental-data-types>` or a one
character typecode of the kind used... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9ffc4a3c-2a49-46a0-b138-63f046776def | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,968 | supabase-export-v2 | 20bf597516afe2b8 | Joining zombie processes
On POSIX when a process finishes but has not been joined it becomes a zombie. There should never be very many because each time a new process starts (or
:func:`~multiprocessing.active_children` is called) all completed processes
which have not yet been joined will be joined. Also calling a fi... | trusted_official_docs | CPython Docs | Joining zombie processes
On POSIX when a process finishes but has not been joined it becomes a zombie. There should never be very many because each time a new process starts (or
:func:`~multiprocessing.active_children` is called) all completed processes
which have not yet been joined will be joined. Also calling a fi... | Joining zombie processes
On POSIX when a process finishes but has not been joined it becomes a zombie. There should never be very many because each time a new process starts (or
:func:`~multiprocessing.active_children` is called) all completed processes
which have not yet been joined will be joined. Also calling a fi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a12e9435-ff96-4087-8b71-562cad34d6d9 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,341 | supabase-export-v2 | 518df72eae12b9bc | for each task removed from the queue or else the semaphore used to count the number of unfinished tasks may eventually overflow, raising an exception.
One difference from other Python queue implementations, is that :mod:`!multiprocessing`
queues serializes all objects that are put into them using :mod:`pickle`. The obj... | trusted_official_docs | CPython Docs | for each task removed from the queue or else the semaphore used to count the number of unfinished tasks may eventually overflow, raising an exception.
One difference from other Python queue implementations, is that :mod:`!multiprocessing`
queues serializes all objects that are put into them using :mod:`pickle`. The obj... | for each task removed from the queue or else the semaphore used to count the number of unfinished tasks may eventually overflow, raising an exception.
One difference from other Python queue implementations, is that :mod:`!multiprocessing`
queues serializes all objects that are put into them using :mod:`pickle`. The obj... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a2172cc9-2e76-4f76-8bed-3b096e8db2f0 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,132 | supabase-export-v2 | daef31e2378375a7 | Due to this, the :mod:`!multiprocessing` module allows the programmer to fully leverage multiple processors on a given machine. It runs on both POSIX and Windows.
The :mod:`!multiprocessing` module also introduces the
:class:`~multiprocessing.pool.Pool` object which offers a convenient means of
parallelizing the execut... | trusted_official_docs | CPython Docs | Due to this, the :mod:`!multiprocessing` module allows the programmer to fully leverage multiple processors on a given machine. It runs on both POSIX and Windows.
The :mod:`!multiprocessing` module also introduces the
:class:`~multiprocessing.pool.Pool` object which offers a convenient means of
parallelizing the execut... | Due to this, the :mod:`!multiprocessing` module allows the programmer to fully leverage multiple processors on a given machine. It runs on both POSIX and Windows.
The :mod:`!multiprocessing` module also introduces the
:class:`~multiprocessing.pool.Pool` object which offers a convenient means of
parallelizing the execut... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a3be89c7-69f3-4782-98c2-3a3a143256c5 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,945 | supabase-export-v2 | 9f8cfb27aef93ff0 | .. currentmodule:: multiprocessing.pool
In particular, the ``Pool`` function provided by :mod:`!multiprocessing.dummy`
returns an instance of :class:`ThreadPool`, which is a subclass of
:class:`Pool` that supports all the same method calls but uses a pool of
worker threads rather than worker processes. | trusted_official_docs | CPython Docs | .. currentmodule:: multiprocessing.pool
In particular, the ``Pool`` function provided by :mod:`!multiprocessing.dummy`
returns an instance of :class:`ThreadPool`, which is a subclass of
:class:`Pool` that supports all the same method calls but uses a pool of
worker threads rather than worker processes. | .. currentmodule:: multiprocessing.pool
In particular, the ``Pool`` function provided by :mod:`!multiprocessing.dummy`
returns an instance of :class:`ThreadPool`, which is a subclass of
:class:`Pool` that supports all the same method calls but uses a pool of
worker threads rather than worker processes. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a422608d-c384-4ac2-8492-35a498a324e6 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,500 | supabase-export-v2 | af47a1ddd031d24e | .. method:: recv_bytes_into(buf[, offset])
Read into *buf* a complete message of byte data sent from the other end
of the connection and return the number of bytes in the message. 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_bytes_into(buf[, offset])
Read into *buf* a complete message of byte data sent from the other end
of the connection and return the number of bytes in the message. 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_bytes_into(buf[, offset])
Read into *buf* a complete message of byte data sent from the other end
of the connection and return the number of bytes in the message. 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 | |
a4c7a62b-2e7e-4803-b273-4466f7a51738 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,512 | supabase-export-v2 | 2c094100590a3945 | .. warning::
If a process is killed while it is trying to read or write to a pipe then
the data in the pipe is likely to become corrupted, because it may become
impossible to be sure where the message boundaries lie. | trusted_official_docs | CPython Docs | .. warning::
If a process is killed while it is trying to read or write to a pipe then
the data in the pipe is likely to become corrupted, because it may become
impossible to be sure where the message boundaries lie. | .. warning::
If a process is killed while it is trying to read or write to a pipe then
the data in the pipe is likely to become corrupted, because it may become
impossible to be sure where the message boundaries lie. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a5857f58-5018-401a-8551-8a1f1b0ffaf0 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,390 | supabase-export-v2 | bd38dc7aefe3c7c0 | after :meth:`close` has been called. It blocks until the background thread exits, ensuring that all data in the buffer has been flushed to the pipe.
By default if a process is not the creator of the queue then on exit it
will attempt to join the queue's background thread. The process can call
:meth:`cancel_join_threa... | trusted_official_docs | CPython Docs | after :meth:`close` has been called. It blocks until the background thread exits, ensuring that all data in the buffer has been flushed to the pipe.
By default if a process is not the creator of the queue then on exit it
will attempt to join the queue's background thread. The process can call
:meth:`cancel_join_threa... | after :meth:`close` has been called. It blocks until the background thread exits, ensuring that all data in the buffer has been flushed to the pipe.
By default if a process is not the creator of the queue then on exit it
will attempt to join the queue's background thread. The process can call
:meth:`cancel_join_threa... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a6d6b327-17c5-4bdc-ba4a-abab0b0f8583 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,928 | supabase-export-v2 | 4a3a40e48b7b671e | that (by default) all processes of a multi-process program will share a single authentication key which can be used when setting up connections between themselves.
Suitable authentication keys can also be generated by using :func:`os.urandom`. | trusted_official_docs | CPython Docs | that (by default) all processes of a multi-process program will share a single authentication key which can be used when setting up connections between themselves.
Suitable authentication keys can also be generated by using :func:`os.urandom`. | that (by default) all processes of a multi-process program will share a single authentication key which can be used when setting up connections between themselves.
Suitable authentication keys can also be generated by using :func:`os.urandom`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a6fce76b-37d2-466d-b377-17ff05d7f04f | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,496 | supabase-export-v2 | f14fa18601b7a62e | .. method:: recv_bytes([maxlength])
Return a complete message of byte data sent from the other end of the
connection as a string. Blocks until there is something to receive. Raises :exc:`EOFError` if there is nothing left
to receive and the other end has closed. | trusted_official_docs | CPython Docs | .. method:: recv_bytes([maxlength])
Return a complete message of byte data sent from the other end of the
connection as a string. Blocks until there is something to receive. Raises :exc:`EOFError` if there is nothing left
to receive and the other end has closed. | .. method:: recv_bytes([maxlength])
Return a complete message of byte data sent from the other end of the
connection as a string. Blocks until there is something to receive. Raises :exc:`EOFError` if there is nothing left
to receive and the other end has closed. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a85cbe68-dbc8-4aa2-ac3a-e0064a33e91a | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,156 | supabase-export-v2 | 1f5f55dd2e887f8f | .. _multiprocessing-start-method-spawn:
*spawn*
The parent process starts a fresh Python interpreter process. The
child process will only inherit those resources necessary to run
the process object's :meth:`~Process.run` method. In particular,
unnecessary file descriptors and handles from the parent process
will n... | trusted_official_docs | CPython Docs | .. _multiprocessing-start-method-spawn:
*spawn*
The parent process starts a fresh Python interpreter process. The
child process will only inherit those resources necessary to run
the process object's :meth:`~Process.run` method. In particular,
unnecessary file descriptors and handles from the parent process
will n... | .. _multiprocessing-start-method-spawn:
*spawn*
The parent process starts a fresh Python interpreter process. The
child process will only inherit those resources necessary to run
the process object's :meth:`~Process.run` method. In particular,
unnecessary file descriptors and handles from the parent process
will n... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a9286491-2ad1-4b0d-8449-cdd6c4483d84 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,595 | supabase-export-v2 | ded4b77d1fdb0487 | will be initially zeroed. Otherwise, *size_or_initializer* is a sequence which is used to initialize the array and whose length determines the length of the array.
If *lock* is ``True`` (the default) then a new lock object is created to
synchronize access to the value. If *lock* is a :class:`Lock` or
:class:`RLock` o... | trusted_official_docs | CPython Docs | will be initially zeroed. Otherwise, *size_or_initializer* is a sequence which is used to initialize the array and whose length determines the length of the array.
If *lock* is ``True`` (the default) then a new lock object is created to
synchronize access to the value. If *lock* is a :class:`Lock` or
:class:`RLock` o... | will be initially zeroed. Otherwise, *size_or_initializer* is a sequence which is used to initialize the array and whose length determines the length of the array.
If *lock* is ``True`` (the default) then a new lock object is created to
synchronize access to the value. If *lock* is a :class:`Lock` or
:class:`RLock` o... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a9ed31f3-5908-4f92-aa05-727d99e1baca | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,455 | supabase-export-v2 | 17eacf62d42d6506 | .. versionchanged:: 3.8
On macOS, the *spawn* start method is now the default. The *fork* start
method should be considered unsafe as it can lead to crashes of the
subprocess. See :issue:`33725`. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.8
On macOS, the *spawn* start method is now the default. The *fork* start
method should be considered unsafe as it can lead to crashes of the
subprocess. See :issue:`33725`. | .. versionchanged:: 3.8
On macOS, the *spawn* start method is now the default. The *fork* start
method should be considered unsafe as it can lead to crashes of the
subprocess. See :issue:`33725`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aa30057a-377e-4afc-8f5c-3c15c34640e0 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,540 | supabase-export-v2 | be8bd7e061f50a3e | Note that :class:`Lock` is actually a factory function which returns an instance of ``multiprocessing.synchronize.Lock`` initialized with a default context.
Instantiating this class may set the global start method. See
:ref:`global-start-method` for more details. | trusted_official_docs | CPython Docs | Note that :class:`Lock` is actually a factory function which returns an instance of ``multiprocessing.synchronize.Lock`` initialized with a default context.
Instantiating this class may set the global start method. See
:ref:`global-start-method` for more details. | Note that :class:`Lock` is actually a factory function which returns an instance of ``multiprocessing.synchronize.Lock`` initialized with a default context.
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 | |
aad66322-8bb5-4c2c-abf1-bb0e4cb398bd | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,892 | supabase-export-v2 | 9c43194cf5f9ea7c | most that many seconds. If *timeout* is ``None`` then it will block for an unlimited period. A negative timeout is equivalent to a zero timeout.
For both POSIX and Windows, an object can appear in *object_list* if
it is | trusted_official_docs | CPython Docs | most that many seconds. If *timeout* is ``None`` then it will block for an unlimited period. A negative timeout is equivalent to a zero timeout.
For both POSIX and Windows, an object can appear in *object_list* if
it is | most that many seconds. If *timeout* is ``None`` then it will block for an unlimited period. A negative timeout is equivalent to a zero timeout.
For both POSIX and Windows, an object can appear in *object_list* if
it is | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
abe2e1c2-b723-4488-891b-0a2bc26b9ad6 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,619 | supabase-export-v2 | da94a19948a13146 | 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.
If *lock* is ``True`` (the default) then a new lock object is created to
synchronize access to the value. If *lock* is a :class:`~multiprocessing.Lock` or
:c... | trusted_official_docs | CPython Docs | 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.
If *lock* is ``True`` (the default) then a new lock object is created to
synchronize access to the value. If *lock* is a :class:`~multiprocessing.Lock` or
:c... | 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.
If *lock* is ``True`` (the default) then a new lock object is created to
synchronize access to the value. If *lock* is a :class:`~multiprocessing.Lock` or
:c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ac27a6f1-526a-436d-bf7e-2aeeee2a81ef | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,417 | supabase-export-v2 | b9ba26d7abe09e44 | Block until all items in the queue have been gotten and processed.
The count of unfinished tasks goes up whenever an item is added to the
queue. The count goes down whenever a consumer calls
:meth:`task_done` to indicate that the item was retrieved and all work on
it is complete. When the count of unfinished tasks d... | trusted_official_docs | CPython Docs | Block until all items in the queue have been gotten and processed.
The count of unfinished tasks goes up whenever an item is added to the
queue. The count goes down whenever a consumer calls
:meth:`task_done` to indicate that the item was retrieved and all work on
it is complete. When the count of unfinished tasks d... | Block until all items in the queue have been gotten and processed.
The count of unfinished tasks goes up whenever an item is added to the
queue. The count goes down whenever a consumer calls
:meth:`task_done` to indicate that the item was retrieved and all work on
it is complete. When the count of unfinished tasks d... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
acf7f355-eafc-4cd7-a457-7e8e59827b4a | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,497 | supabase-export-v2 | 15ee72bc7ddf87a7 | as a string. Blocks until there is something to receive. Raises :exc:`EOFError` if there is nothing left to receive and the other end has closed.
If *maxlength* is specified and the message is longer than *maxlength*
then :exc:`OSError` is raised and the connection will no longer be
readable. | trusted_official_docs | CPython Docs | as a string. Blocks until there is something to receive. Raises :exc:`EOFError` if there is nothing left to receive and the other end has closed.
If *maxlength* is specified and the message is longer than *maxlength*
then :exc:`OSError` is raised and the connection will no longer be
readable. | as a string. Blocks until there is something to receive. Raises :exc:`EOFError` if there is nothing left to receive and the other end has closed.
If *maxlength* is specified and the message is longer than *maxlength*
then :exc:`OSError` is raised and the connection will no longer be
readable. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ad2dbd90-038b-4b5b-83ed-d935830a8ab4 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,647 | supabase-export-v2 | 54516527a668fc13 | objects between processes. The returned manager object corresponds to a spawned child process and has methods which will create shared objects and return corresponding proxies.
.. module:: multiprocessing.managers
:synopsis: Share data between process with shared objects. | trusted_official_docs | CPython Docs | objects between processes. The returned manager object corresponds to a spawned child process and has methods which will create shared objects and return corresponding proxies.
.. module:: multiprocessing.managers
:synopsis: Share data between process with shared objects. | objects between processes. The returned manager object corresponds to a spawned child process and has methods which will create shared objects and return corresponding proxies.
.. module:: multiprocessing.managers
:synopsis: Share data between process with shared objects. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ad942efb-36cc-4d47-971d-129b88549324 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,883 | supabase-export-v2 | bc5f65ed66e763d0 | .. method:: close()
Close the bound socket 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. | trusted_official_docs | CPython Docs | .. method:: close()
Close the bound socket 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. | .. method:: close()
Close the bound socket 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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ae65f3e8-3a35-4aec-8220-1e22df0a390c | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,937 | supabase-export-v2 | 2ec21d0695524c35 | .. currentmodule:: multiprocessing .. function:: log_to_stderr(level=None)
This function performs a call to :func:`get_logger` but in addition to
returning the logger created by get_logger, it adds a handler which sends
output to :data:`sys.stderr` using format
``'[%(levelname)s/%(processName)s] %(message)s'``. You ... | trusted_official_docs | CPython Docs | .. currentmodule:: multiprocessing .. function:: log_to_stderr(level=None)
This function performs a call to :func:`get_logger` but in addition to
returning the logger created by get_logger, it adds a handler which sends
output to :data:`sys.stderr` using format
``'[%(levelname)s/%(processName)s] %(message)s'``. You ... | .. currentmodule:: multiprocessing .. function:: log_to_stderr(level=None)
This function performs a call to :func:`get_logger` but in addition to
returning the logger created by get_logger, it adds a handler which sends
output to :data:`sys.stderr` using format
``'[%(levelname)s/%(processName)s] %(message)s'``. You ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aefe534a-ac1a-4034-b569-b64e2aa68aee | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,361 | supabase-export-v2 | 483f8c240401d66f | .. class:: Queue([maxsize])
Returns a process shared queue implemented using a pipe and a few
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. | trusted_official_docs | CPython Docs | .. class:: Queue([maxsize])
Returns a process shared queue implemented using a pipe and a few
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. | .. class:: Queue([maxsize])
Returns a process shared queue implemented using a pipe and a few
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
afc53c5b-1de4-459c-b04b-f5f45f4793fe | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,139 | supabase-export-v2 | c5cb4bdd3a0cdb3c | .. seealso::
:class:`concurrent.futures.ProcessPoolExecutor` offers a higher level interface
to push tasks to a background process without blocking execution of the
calling process. Compared to using the :class:`~multiprocessing.pool.Pool`
interface directly, the :mod:`concurrent.futures` API more readily allows
th... | trusted_official_docs | CPython Docs | .. seealso::
:class:`concurrent.futures.ProcessPoolExecutor` offers a higher level interface
to push tasks to a background process without blocking execution of the
calling process. Compared to using the :class:`~multiprocessing.pool.Pool`
interface directly, the :mod:`concurrent.futures` API more readily allows
th... | .. seealso::
:class:`concurrent.futures.ProcessPoolExecutor` offers a higher level interface
to push tasks to a background process without blocking execution of the
calling process. Compared to using the :class:`~multiprocessing.pool.Pool`
interface directly, the :mod:`concurrent.futures` API more readily allows
th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b088e02c-5b30-4780-95d5-975787ce6a65 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,733 | supabase-export-v2 | 5ae1b41e4aadf047 | Using a remote manager """"""""""""""""""""""
It 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). | trusted_official_docs | CPython Docs | Using a remote manager """"""""""""""""""""""
It 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). | Using a remote manager """"""""""""""""""""""
It 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). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b170ce84-969a-4798-a566-403f997a1b4b | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,292 | supabase-export-v2 | 78dda079164ff9d6 | exits. Additionally, these are **not** Unix daemons or services, they are normal processes that will be terminated (and not joined) if non-daemonic processes have exited.
In addition to the :class:`threading.Thread` API, :class:`Process` objects
also support the following attributes and methods: | trusted_official_docs | CPython Docs | exits. Additionally, these are **not** Unix daemons or services, they are normal processes that will be terminated (and not joined) if non-daemonic processes have exited.
In addition to the :class:`threading.Thread` API, :class:`Process` objects
also support the following attributes and methods: | exits. Additionally, these are **not** Unix daemons or services, they are normal processes that will be terminated (and not joined) if non-daemonic processes have exited.
In addition to the :class:`threading.Thread` API, :class:`Process` objects
also support the following attributes and methods: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b1aa5ced-c65b-4b40-9c77-cfc10049c986 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,363 | supabase-export-v2 | 75cf3bb890b00d44 | Instantiating this class may set the global start method. See :ref:`global-start-method` for more details.
The usual :exc:`queue.Empty` and :exc:`queue.Full` exceptions from the
standard library's :mod:`queue` module are raised to signal timeouts. | trusted_official_docs | CPython Docs | Instantiating this class may set the global start method. See :ref:`global-start-method` for more details.
The usual :exc:`queue.Empty` and :exc:`queue.Full` exceptions from the
standard library's :mod:`queue` module are raised to signal timeouts. | Instantiating this class may set the global start method. See :ref:`global-start-method` for more details.
The usual :exc:`queue.Empty` and :exc:`queue.Full` exceptions from the
standard library's :mod:`queue` module are raised to signal timeouts. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b3ad0a70-5787-4929-8077-16c8d3e200c9 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,243 | supabase-export-v2 | 09d15801719fe753 | # make a single worker sleep for 10 seconds res = pool.apply_async(time.sleep, (10,)) try: print(res.get(timeout=1)) except TimeoutError: print("We lacked patience and got a multiprocessing.TimeoutError")
print("For the moment, the pool remains available for more work") | trusted_official_docs | CPython Docs | # make a single worker sleep for 10 seconds res = pool.apply_async(time.sleep, (10,)) try: print(res.get(timeout=1)) except TimeoutError: print("We lacked patience and got a multiprocessing.TimeoutError")
print("For the moment, the pool remains available for more work") | # make a single worker sleep for 10 seconds res = pool.apply_async(time.sleep, (10,)) try: print(res.get(timeout=1)) except TimeoutError: print("We lacked patience and got a multiprocessing.TimeoutError")
print("For the moment, the pool remains available for more work") | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b6952330-c38d-4e96-bf3f-18f04dceee90 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,510 | supabase-export-v2 | 7a11118af3240ac3 | The :meth:`Connection.recv` method automatically unpickles the data it receives, which can be a security risk unless you can trust the process which sent the message.
Therefore, unless the connection object was produced using :func:`Pipe` you
should only use the :meth:`~Connection.recv` and :meth:`~Connection.send`
m... | trusted_official_docs | CPython Docs | The :meth:`Connection.recv` method automatically unpickles the data it receives, which can be a security risk unless you can trust the process which sent the message.
Therefore, unless the connection object was produced using :func:`Pipe` you
should only use the :meth:`~Connection.recv` and :meth:`~Connection.send`
m... | The :meth:`Connection.recv` method automatically unpickles the data it receives, which can be a security risk unless you can trust the process which sent the message.
Therefore, unless the connection object was produced using :func:`Pipe` you
should only use the :meth:`~Connection.recv` and :meth:`~Connection.send`
m... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b88564f4-458d-4acc-a915-6c1a76d3337e | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,230 | supabase-export-v2 | 2b93de2129660780 | {0.25: None, 1: '1', '2': 2} [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] {'a', 'b'}
Server process managers are more flexible than using shared memory objects
because they can be made to support arbitrary object types. Also, a single
manager can be shared by processes on different computers over a network. They are, however, slow... | trusted_official_docs | CPython Docs | {0.25: None, 1: '1', '2': 2} [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] {'a', 'b'}
Server process managers are more flexible than using shared memory objects
because they can be made to support arbitrary object types. Also, a single
manager can be shared by processes on different computers over a network. They are, however, slow... | {0.25: None, 1: '1', '2': 2} [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] {'a', 'b'}
Server process managers are more flexible than using shared memory objects
because they can be made to support arbitrary object types. Also, a single
manager can be shared by processes on different computers over a network. They are, however, slow... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b88eb39e-58fb-4d28-8211-85d04673b8aa | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,412 | supabase-export-v2 | 288bd24f9b704448 | .. method:: task_done()
Indicate that a formerly enqueued task is complete. Used by queue
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. | trusted_official_docs | CPython Docs | .. method:: task_done()
Indicate that a formerly enqueued task is complete. Used by queue
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. | .. method:: task_done()
Indicate that a formerly enqueued task is complete. Used by queue
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b8d58a7a-f366-4561-aae8-d632b48d3778 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,794 | supabase-export-v2 | 8be765d6e4f2f669 | If *initializer* is not ``None`` then each worker process will call ``initializer(*initargs)`` when it starts.
*maxtasksperchild* is the number of tasks a worker process can complete
before it will exit and be replaced with a fresh worker process, to enable
unused resources to be freed. The default *maxtasksperchild*... | trusted_official_docs | CPython Docs | If *initializer* is not ``None`` then each worker process will call ``initializer(*initargs)`` when it starts.
*maxtasksperchild* is the number of tasks a worker process can complete
before it will exit and be replaced with a fresh worker process, to enable
unused resources to be freed. The default *maxtasksperchild*... | If *initializer* is not ``None`` then each worker process will call ``initializer(*initargs)`` when it starts.
*maxtasksperchild* is the number of tasks a worker process can complete
before it will exit and be replaced with a fresh worker process, to enable
unused resources to be freed. The default *maxtasksperchild*... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b8dcbcc4-52e9-495e-b2d8-8a65d1daada3 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,879 | supabase-export-v2 | 1335a3cdd933f3d9 | the listener object uses a socket then *backlog* (1 by default) is passed to the :meth:`~socket.socket.listen` method of the socket once it has been bound.
If *authkey* is given and not ``None``, it should be a byte string and will be
used as the secret key for an HMAC-based authentication challenge. No
authenticatio... | trusted_official_docs | CPython Docs | the listener object uses a socket then *backlog* (1 by default) is passed to the :meth:`~socket.socket.listen` method of the socket once it has been bound.
If *authkey* is given and not ``None``, it should be a byte string and will be
used as the secret key for an HMAC-based authentication challenge. No
authenticatio... | the listener object uses a socket then *backlog* (1 by default) is passed to the :meth:`~socket.socket.listen` method of the socket once it has been bound.
If *authkey* is given and not ``None``, it should be a byte string and will be
used as the secret key for an HMAC-based authentication challenge. No
authenticatio... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b9beb4c4-a292-43e0-84f2-85b82e1f9067 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,825 | supabase-export-v2 | 61c232c612ade21e | .. method:: imap_unordered(func, iterable[, chunksize])
The same as :meth:`imap` except that the ordering of the results from the
returned iterator should be considered arbitrary. (Only when there is
only one worker process is the order guaranteed to be "correct".) | trusted_official_docs | CPython Docs | .. method:: imap_unordered(func, iterable[, chunksize])
The same as :meth:`imap` except that the ordering of the results from the
returned iterator should be considered arbitrary. (Only when there is
only one worker process is the order guaranteed to be "correct".) | .. method:: imap_unordered(func, iterable[, chunksize])
The same as :meth:`imap` except that the ordering of the results from the
returned iterator should be considered arbitrary. (Only when there is
only one worker process is the order guaranteed to be "correct".) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ba09ab84-d17e-42fe-993d-3c65da31020a | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,298 | supabase-export-v2 | 8db7ad2c3e0435f7 | method returned normally, the exit code will be 0. If it terminated via :func:`sys.exit` with an integer argument *N*, the exit code will be *N*.
If the child terminated due to an exception not caught within
:meth:`run`, the exit code will be 1. If it was terminated by
signal *N*, the exit code will be the negative v... | trusted_official_docs | CPython Docs | method returned normally, the exit code will be 0. If it terminated via :func:`sys.exit` with an integer argument *N*, the exit code will be *N*.
If the child terminated due to an exception not caught within
:meth:`run`, the exit code will be 1. If it was terminated by
signal *N*, the exit code will be the negative v... | method returned normally, the exit code will be 0. If it terminated via :func:`sys.exit` with an integer argument *N*, the exit code will be *N*.
If the child terminated due to an exception not caught within
:meth:`run`, the exit code will be 1. If it was terminated by
signal *N*, the exit code will be the negative v... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ba5f36f0-a823-4eca-a95a-6f40ca31c45f | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,219 | supabase-export-v2 | bb2464d32c9446f0 | 3.1415927 [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
The ``'d'`` and ``'i'`` arguments used when creating ``num`` and ``arr`` are
typecodes of the kind used by the :mod:`array` module: ``'d'`` indicates a
double precision float and ``'i'`` indicates a signed integer. These shared
objects will be process and thread-safe... | trusted_official_docs | CPython Docs | 3.1415927 [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
The ``'d'`` and ``'i'`` arguments used when creating ``num`` and ``arr`` are
typecodes of the kind used by the :mod:`array` module: ``'d'`` indicates a
double precision float and ``'i'`` indicates a signed integer. These shared
objects will be process and thread-safe... | 3.1415927 [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
The ``'d'`` and ``'i'`` arguments used when creating ``num`` and ``arr`` are
typecodes of the kind used by the :mod:`array` module: ``'d'`` indicates a
double precision float and ``'i'`` indicates a signed integer. These shared
objects will be process and thread-safe... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ba669dd1-d5a2-4725-aba8-53c4c060ebc2 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,265 | supabase-export-v2 | 494bb472b3d0b958 | die via an uncaught :exc:`AttributeError` exception when starting as *target* must have been defined within an importable module in order to be loaded during unpickling.
Example of this uncatchable error from the child:: | trusted_official_docs | CPython Docs | die via an uncaught :exc:`AttributeError` exception when starting as *target* must have been defined within an importable module in order to be loaded during unpickling.
Example of this uncatchable error from the child:: | die via an uncaught :exc:`AttributeError` exception when starting as *target* must have been defined within an importable module in order to be loaded during unpickling.
Example of this uncatchable error from the child:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bae82c1b-06a7-4649-a11a-95d30ac9033a | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,586 | supabase-export-v2 | a6836218062bf210 | 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.
If *lock* is ``True`` (the default) then a new recursive lock
object is created to synchronize access to the value. If *lock* is
a :class:`Lock` or :class:`RLock` object then tha... | 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.
If *lock* is ``True`` (the default) then a new recursive lock
object is created to synchronize access to the value. If *lock* is
a :class:`Lock` or :class:`RLock` object then tha... | 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.
If *lock* is ``True`` (the default) then a new recursive lock
object is created to synchronize access to the value. If *lock* is
a :class:`Lock` or :class:`RLock` object then tha... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bc198ce7-68d2-4150-90ad-5efc0798e6c3 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,264 | supabase-export-v2 | b52e0bc0ad6b0d77 | 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.
Passing a callable object defined in the current REPL session causes the
child process to die via an uncaught :exc:`Attribute... | trusted_official_docs | CPython Docs | 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.
Passing a callable object defined in the current REPL session causes the
child process to die via an uncaught :exc:`Attribute... | 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.
Passing a callable object defined in the current REPL session causes the
child process to die via an uncaught :exc:`Attribute... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bc8eb184-2b32-4632-a615-871bff47c6cf | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,609 | supabase-export-v2 | b502fd9465fb221a | Return a ctypes object allocated from shared memory.
*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. *\*args* is passed on to the constructor for the type. | trusted_official_docs | CPython Docs | Return a ctypes object allocated from shared memory.
*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. *\*args* is passed on to the constructor for the type. | Return a ctypes object allocated from shared memory.
*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. *\*args* is passed on to the constructor for the type. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bdc9e7b6-26c2-41ba-831a-70e4de5aee5c | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,804 | supabase-export-v2 | 195d5809fff55162 | cleaned up and a new process spawned to replace the old one. The *maxtasksperchild* argument to the :class:`Pool` exposes this ability to the end user.
.. method:: apply(func[, args[, kwds]]) | trusted_official_docs | CPython Docs | cleaned up and a new process spawned to replace the old one. The *maxtasksperchild* argument to the :class:`Pool` exposes this ability to the end user.
.. method:: apply(func[, args[, kwds]]) | cleaned up and a new process spawned to replace the old one. The *maxtasksperchild* argument to the :class:`Pool` exposes this ability to the end user.
.. method:: apply(func[, args[, kwds]]) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
be91cfed-ec41-431c-8796-2a958db742eb | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,803 | supabase-export-v2 | a212953bd57b4e62 | .. note::
Worker processes within a :class:`Pool` typically live for the complete
duration of the Pool's work queue. A frequent pattern found in other
systems (such as Apache, mod_wsgi, etc) to free resources held by
workers is to allow a worker within a pool to complete only a set
amount of work before exiting, be... | trusted_official_docs | CPython Docs | .. note::
Worker processes within a :class:`Pool` typically live for the complete
duration of the Pool's work queue. A frequent pattern found in other
systems (such as Apache, mod_wsgi, etc) to free resources held by
workers is to allow a worker within a pool to complete only a set
amount of work before exiting, be... | .. note::
Worker processes within a :class:`Pool` typically live for the complete
duration of the Pool's work queue. A frequent pattern found in other
systems (such as Apache, mod_wsgi, etc) to free resources held by
workers is to allow a worker within a pool to complete only a set
amount of work before exiting, be... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bf0cf17e-95b0-4130-bf03-ac5b0bf5b022 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,584 | supabase-export-v2 | 1a8dd260d755c3d0 | .. function:: Value(typecode_or_type, *args, lock=True)
Return a :mod:`ctypes` object allocated from shared memory. By 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`. | trusted_official_docs | CPython Docs | .. function:: Value(typecode_or_type, *args, lock=True)
Return a :mod:`ctypes` object allocated from shared memory. By 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`. | .. function:: Value(typecode_or_type, *args, lock=True)
Return a :mod:`ctypes` object allocated from shared memory. By 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`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bf8fc854-0fc1-42c2-a656-1933f13bea47 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,605 | supabase-export-v2 | f435a08ef90b0b4b | Return a ctypes array allocated from shared memory.
*typecode_or_type* determines the type of the elements of the returned array:
it is either a ctypes type or a one character typecode of the kind used by
the :mod:`array` module. If *size_or_initializer* is an integer then it
determines the length of the array, and ... | trusted_official_docs | CPython Docs | Return a ctypes array allocated from shared memory.
*typecode_or_type* determines the type of the elements of the returned array:
it is either a ctypes type or a one character typecode of the kind used by
the :mod:`array` module. If *size_or_initializer* is an integer then it
determines the length of the array, and ... | Return a ctypes array allocated from shared memory.
*typecode_or_type* determines the type of the elements of the returned array:
it is either a ctypes type or a one character typecode of the kind used by
the :mod:`array` module. If *size_or_initializer* is an integer then it
determines the length of the array, and ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bfc89261-9b26-4b68-baa6-f99f7e97786d | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,878 | supabase-export-v2 | 7a2ef3ac48318613 | :ref:`multiprocessing-address-formats`. Note that if *family* is ``'AF_UNIX'`` and address is ``None`` then the socket will be created in a private temporary directory created using :func:`tempfile.mkstemp`.
If the listener object uses a socket then *backlog* (1 by default) is passed
to the :meth:`~socket.socket.liste... | trusted_official_docs | CPython Docs | :ref:`multiprocessing-address-formats`. Note that if *family* is ``'AF_UNIX'`` and address is ``None`` then the socket will be created in a private temporary directory created using :func:`tempfile.mkstemp`.
If the listener object uses a socket then *backlog* (1 by default) is passed
to the :meth:`~socket.socket.liste... | :ref:`multiprocessing-address-formats`. Note that if *family* is ``'AF_UNIX'`` and address is ``None`` then the socket will be created in a private temporary directory created using :func:`tempfile.mkstemp`.
If the listener object uses a socket then *backlog* (1 by default) is passed
to the :meth:`~socket.socket.liste... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c0a368a3-19ff-4024-8b14-3a796aca3576 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 7,012 | supabase-export-v2 | 54cd6a7545560b2c | Safe importing of main module
Make 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). | trusted_official_docs | CPython Docs | Safe importing of main module
Make 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). | Safe importing of main module
Make 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). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c1626cb6-91a1-474d-b0bf-7c1122f80e17 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,131 | supabase-export-v2 | ccfcdd347d10c860 | Introduction ------------
:mod:`!multiprocessing` is a package that supports spawning processes using an
API similar to the :mod:`threading` module. The :mod:`!multiprocessing` package
offers both local and remote concurrency, effectively side-stepping the
:term:`Global Interpreter Lock <global interpreter lock>` by us... | trusted_official_docs | CPython Docs | Introduction ------------
:mod:`!multiprocessing` is a package that supports spawning processes using an
API similar to the :mod:`threading` module. The :mod:`!multiprocessing` package
offers both local and remote concurrency, effectively side-stepping the
:term:`Global Interpreter Lock <global interpreter lock>` by us... | Introduction ------------
:mod:`!multiprocessing` is a package that supports spawning processes using an
API similar to the :mod:`threading` module. The :mod:`!multiprocessing` package
offers both local and remote concurrency, effectively side-stepping the
:term:`Global Interpreter Lock <global interpreter lock>` by us... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c16c54e0-27ea-4ac0-aa83-f2b227bbe388 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,240 | supabase-export-v2 | eb9a0fa24d0d70fc | # evaluate "f(20)" asynchronously res = pool.apply_async(f, (20,)) # runs in *only* one process print(res.get(timeout=1)) # prints "400"
# 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 | trusted_official_docs | CPython Docs | # evaluate "f(20)" asynchronously res = pool.apply_async(f, (20,)) # runs in *only* one process print(res.get(timeout=1)) # prints "400"
# 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 | # evaluate "f(20)" asynchronously res = pool.apply_async(f, (20,)) # runs in *only* one process print(res.get(timeout=1)) # prints "400"
# 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 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c2c04fc1-6d84-45c7-8dbc-c5bf3273faca | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,855 | supabase-export-v2 | 8a6c266be41fc029 | print(pool.map(f, range(10))) # prints "[0, 1, 4,..., 81]"
it = pool.imap(f, range(10))
print(next(it)) # prints "0"
print(next(it)) # prints "1"
print(it.next(timeout=1)) # prints "4" unless your computer is *very* slow | trusted_official_docs | CPython Docs | print(pool.map(f, range(10))) # prints "[0, 1, 4,..., 81]"
it = pool.imap(f, range(10))
print(next(it)) # prints "0"
print(next(it)) # prints "1"
print(it.next(timeout=1)) # prints "4" unless your computer is *very* slow | print(pool.map(f, range(10))) # prints "[0, 1, 4,..., 81]"
it = pool.imap(f, range(10))
print(next(it)) # prints "0"
print(next(it)) # prints "1"
print(it.next(timeout=1)) # prints "4" unless your computer is *very* slow | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c3f94ea2-c147-44fc-a2e9-327563e0048f | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,983 | supabase-export-v2 | 89f3affeb93b14ab | Explicitly pass resources to child processes
On POSIX using the *fork* start method, a child process can make
use of a shared resource created in 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. | trusted_official_docs | CPython Docs | Explicitly pass resources to child processes
On POSIX using the *fork* start method, a child process can make
use of a shared resource created in 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. | Explicitly pass resources to child processes
On POSIX using the *fork* start method, a child process can make
use of a shared resource created in 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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c5180c19-144d-46e9-a8ba-925dcfb7327f | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,220 | supabase-export-v2 | 1d847dd282b3f65e | used by the :mod:`array` module: ``'d'`` indicates a double precision float and ``'i'`` indicates a signed integer. These shared objects will be process and thread-safe.
For more flexibility in using shared memory one can use the
:mod:`multiprocessing.sharedctypes` module which supports the creation of
arbitrary ctyp... | trusted_official_docs | CPython Docs | used by the :mod:`array` module: ``'d'`` indicates a double precision float and ``'i'`` indicates a signed integer. These shared objects will be process and thread-safe.
For more flexibility in using shared memory one can use the
:mod:`multiprocessing.sharedctypes` module which supports the creation of
arbitrary ctyp... | used by the :mod:`array` module: ``'d'`` indicates a double precision float and ``'i'`` indicates a signed integer. These shared objects will be process and thread-safe.
For more flexibility in using shared memory one can use the
:mod:`multiprocessing.sharedctypes` module which supports the creation of
arbitrary ctyp... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c6360a0e-a2cf-419e-b519-3ad6e96e330b | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,297 | supabase-export-v2 | 9a504b2074c7c9e7 | The child's exit code. This will be ``None`` if the process has not yet terminated.
If the child's :meth:`run` method returned normally, the exit code
will be 0. If it terminated via :func:`sys.exit` with an integer
argument *N*, the exit code will be *N*. | trusted_official_docs | CPython Docs | The child's exit code. This will be ``None`` if the process has not yet terminated.
If the child's :meth:`run` method returned normally, the exit code
will be 0. If it terminated via :func:`sys.exit` with an integer
argument *N*, the exit code will be *N*. | The child's exit code. This will be ``None`` if the process has not yet terminated.
If the child's :meth:`run` method returned normally, the exit code
will be 0. If it terminated via :func:`sys.exit` with an integer
argument *N*, the exit code will be *N*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c6418312-64ca-4572-8800-9c7ad23e4065 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,182 | supabase-export-v2 | 0e5771e8cf7ca645 | if __name__ == '__main__': ctx = mp.get_context('spawn') q = ctx.Queue() p = ctx.Process(target=foo, args=(q,)) p.start() print(q.get()) p.join()
Note that objects related to one context may not be compatible with
processes for a different context. In particular, locks created using
the *fork* context cannot be passed ... | trusted_official_docs | CPython Docs | if __name__ == '__main__': ctx = mp.get_context('spawn') q = ctx.Queue() p = ctx.Process(target=foo, args=(q,)) p.start() print(q.get()) p.join()
Note that objects related to one context may not be compatible with
processes for a different context. In particular, locks created using
the *fork* context cannot be passed ... | if __name__ == '__main__': ctx = mp.get_context('spawn') q = ctx.Queue() p = ctx.Process(target=foo, args=(q,)) p.start() print(q.get()) p.join()
Note that objects related to one context may not be compatible with
processes for a different context. In particular, locks created using
the *fork* context cannot be passed ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c765515c-7713-484f-abc7-6ea636d0a2a7 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,612 | supabase-export-v2 | df0e9f67e6f96b7b | an array of :data:`ctypes.c_char` has ``value`` and ``raw`` attributes which allow one to use it to store and retrieve strings -- see documentation for :mod:`ctypes`.
.. function:: Array(typecode_or_type, size_or_initializer, *, lock=True, ctx=None) | trusted_official_docs | CPython Docs | an array of :data:`ctypes.c_char` has ``value`` and ``raw`` attributes which allow one to use it to store and retrieve strings -- see documentation for :mod:`ctypes`.
.. function:: Array(typecode_or_type, size_or_initializer, *, lock=True, ctx=None) | an array of :data:`ctypes.c_char` has ``value`` and ``raw`` attributes which allow one to use it to store and retrieve strings -- see documentation for :mod:`ctypes`.
.. function:: Array(typecode_or_type, size_or_initializer, *, lock=True, ctx=None) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c7d08eb3-bd05-480c-842d-51809bf14f97 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,812 | supabase-export-v2 | e3639a04175b30bf | .. method:: map(func, iterable[, chunksize])
A parallel equivalent of the :func:`map` built-in function (it supports only
one *iterable* argument though, for multiple iterables see :meth:`starmap`). It blocks until the result is ready. | trusted_official_docs | CPython Docs | .. method:: map(func, iterable[, chunksize])
A parallel equivalent of the :func:`map` built-in function (it supports only
one *iterable* argument though, for multiple iterables see :meth:`starmap`). It blocks until the result is ready. | .. method:: map(func, iterable[, chunksize])
A parallel equivalent of the :func:`map` built-in function (it supports only
one *iterable* argument though, for multiple iterables see :meth:`starmap`). It blocks until the result is ready. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c80df5cb-e766-4961-909a-4b4d6a07f377 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,242 | supabase-export-v2 | e2888fbd0208b696 | # launching multiple evaluations asynchronously *may* use more processes multiple_results = [pool.apply_async(os.getpid, ()) for i in range(4)] print([res.get(timeout=1) for res in multiple_results])
# make a single worker sleep for 10 seconds
res = pool.apply_async(time.sleep, (10,))
try:
print(res.get(timeout=1))
... | trusted_official_docs | CPython Docs | # launching multiple evaluations asynchronously *may* use more processes multiple_results = [pool.apply_async(os.getpid, ()) for i in range(4)] print([res.get(timeout=1) for res in multiple_results])
# make a single worker sleep for 10 seconds
res = pool.apply_async(time.sleep, (10,))
try:
print(res.get(timeout=1))
... | # launching multiple evaluations asynchronously *may* use more processes multiple_results = [pool.apply_async(os.getpid, ()) for i in range(4)] print([res.get(timeout=1) for res in multiple_results])
# make a single worker sleep for 10 seconds
res = pool.apply_async(time.sleep, (10,))
try:
print(res.get(timeout=1))
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c8158c39-7a92-4e37-80e0-74115c425758 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,159 | supabase-export-v2 | 5ff04f4c411f06ab | .. _multiprocessing-start-method-fork:
*fork*
The parent process uses :func:`os.fork` to fork the Python
interpreter. The child process, when it begins, is effectively
identical to the parent process. All resources of the parent are
inherited by the child process. Note that safely forking a
multithreaded process i... | trusted_official_docs | CPython Docs | .. _multiprocessing-start-method-fork:
*fork*
The parent process uses :func:`os.fork` to fork the Python
interpreter. The child process, when it begins, is effectively
identical to the parent process. All resources of the parent are
inherited by the child process. Note that safely forking a
multithreaded process i... | .. _multiprocessing-start-method-fork:
*fork*
The parent process uses :func:`os.fork` to fork the Python
interpreter. The child process, when it begins, is effectively
identical to the parent process. All resources of the parent are
inherited by the child process. Note that safely forking a
multithreaded process i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c863083c-de81-4e9f-acc7-36d8da97996c | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,792 | supabase-export-v2 | 9f1a99bbc30fffe5 | a pool of worker processes to which jobs can be submitted. It supports asynchronous results with timeouts and callbacks and has a parallel map implementation.
*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. | trusted_official_docs | CPython Docs | a pool of worker processes to which jobs can be submitted. It supports asynchronous results with timeouts and callbacks and has a parallel map implementation.
*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. | a pool of worker processes to which jobs can be submitted. It supports asynchronous results with timeouts and callbacks and has a parallel map implementation.
*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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c8895f2d-3089-45b6-bad0-3c282aaa23cb | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,972 | supabase-export-v2 | e5f8dbcbf408ca32 | Avoid terminating processes
Using the :meth:`Process.terminate <multiprocessing.Process.terminate>`
method to stop a process is liable to
cause any shared resources (such as locks, semaphores, pipes and queues)
currently being used by the process to become broken or unavailable to other
processes. | trusted_official_docs | CPython Docs | Avoid terminating processes
Using the :meth:`Process.terminate <multiprocessing.Process.terminate>`
method to stop a process is liable to
cause any shared resources (such as locks, semaphores, pipes and queues)
currently being used by the process to become broken or unavailable to other
processes. | Avoid terminating processes
Using the :meth:`Process.terminate <multiprocessing.Process.terminate>`
method to stop a process is liable to
cause any shared resources (such as locks, semaphores, pipes and queues)
currently being used by the process to become broken or unavailable to other
processes. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c898579b-5f70-483a-8382-5ff54fe60d2c | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,948 | supabase-export-v2 | fb72326ccba3e3de | instances, and their resources must also be properly managed, either by using the pool as a context manager or by calling :meth:`~multiprocessing.pool.Pool.close` and :meth:`~multiprocessing.pool.Pool.terminate` manually.
*processes* is the number of worker threads to use. If *processes* is
``None`` then the number re... | trusted_official_docs | CPython Docs | instances, and their resources must also be properly managed, either by using the pool as a context manager or by calling :meth:`~multiprocessing.pool.Pool.close` and :meth:`~multiprocessing.pool.Pool.terminate` manually.
*processes* is the number of worker threads to use. If *processes* is
``None`` then the number re... | instances, and their resources must also be properly managed, either by using the pool as a context manager or by calling :meth:`~multiprocessing.pool.Pool.close` and :meth:`~multiprocessing.pool.Pool.terminate` manually.
*processes* is the number of worker threads to use. If *processes* is
``None`` then the number re... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c9326710-c7a1-454a-8522-fd5011265d6c | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,395 | supabase-export-v2 | f41c43cb4d981585 | .. note::
This class's functionality requires a functioning shared semaphore
implementation on the host operating system. Without one, the
functionality in this class will be disabled, and attempts to
instantiate a :class:`Queue` will result in an :exc:`ImportError`. See
:issue:`3770` for additional information. Th... | trusted_official_docs | CPython Docs | .. note::
This class's functionality requires a functioning shared semaphore
implementation on the host operating system. Without one, the
functionality in this class will be disabled, and attempts to
instantiate a :class:`Queue` will result in an :exc:`ImportError`. See
:issue:`3770` for additional information. Th... | .. note::
This class's functionality requires a functioning shared semaphore
implementation on the host operating system. Without one, the
functionality in this class will be disabled, and attempts to
instantiate a :class:`Queue` will result in an :exc:`ImportError`. See
:issue:`3770` for additional information. Th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ca03a060-8faf-4105-a14b-ef081e961819 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,280 | supabase-export-v2 | 9323a5926f6f4525 | A process can be joined many times.
A process cannot join itself because this would cause a deadlock. It is
an error to attempt to join a process before it has been started. | trusted_official_docs | CPython Docs | A process can be joined many times.
A process cannot join itself because this would cause a deadlock. It is
an error to attempt to join a process before it has been started. | A process can be joined many times.
A process cannot join itself because this would cause a deadlock. It is
an error to attempt to join a process before it has been started. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ca3be9eb-b7a1-4e99-bcb2-a944bd8fc57c | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,379 | supabase-export-v2 | 56c12d35eb78ba43 | .. method:: get([block[, timeout]])
Remove and return an item from the queue. If optional args *block* is
``True`` (the default) and *timeout* is ``None`` (the default), block if
necessary until an item is available. If *timeout* is a positive number,
it blocks at most *timeout* seconds and raises the :exc:`queue.Em... | trusted_official_docs | CPython Docs | .. method:: get([block[, timeout]])
Remove and return an item from the queue. If optional args *block* is
``True`` (the default) and *timeout* is ``None`` (the default), block if
necessary until an item is available. If *timeout* is a positive number,
it blocks at most *timeout* seconds and raises the :exc:`queue.Em... | .. method:: get([block[, timeout]])
Remove and return an item from the queue. If optional args *block* is
``True`` (the default) and *timeout* is ``None`` (the default), block if
necessary until an item is available. If *timeout* is a positive number,
it blocks at most *timeout* seconds and raises the :exc:`queue.Em... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cb36a656-ff69-44d9-b2df-cbfd6bd805de | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,563 | supabase-export-v2 | cb6aec5743ac4e4a | .. method:: release()
Release a lock, decrementing the recursion level. If after the
decrement the recursion level is zero, reset the lock to unlocked (not
owned by any process or thread) and if any other processes or threads
are blocked waiting for the lock to become unlocked, allow exactly one
of them to proceed.... | trusted_official_docs | CPython Docs | .. method:: release()
Release a lock, decrementing the recursion level. If after the
decrement the recursion level is zero, reset the lock to unlocked (not
owned by any process or thread) and if any other processes or threads
are blocked waiting for the lock to become unlocked, allow exactly one
of them to proceed.... | .. method:: release()
Release a lock, decrementing the recursion level. If after the
decrement the recursion level is zero, reset the lock to unlocked (not
owned by any process or thread) and if any other processes or threads
are blocked waiting for the lock to become unlocked, allow exactly one
of them to proceed.... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cd35fbbe-27c5-4349-a07e-55ba82baaccf | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,614 | supabase-export-v2 | a438175d598a4b96 | The same as :func:`RawArray` except that depending on the value of *lock* a process-safe synchronization wrapper may be returned instead of a raw ctypes array.
If *lock* is ``True`` (the default) then a new lock object is created to
synchronize access to the value. If *lock* is a
:class:`~multiprocessing.Lock` or :cl... | trusted_official_docs | CPython Docs | The same as :func:`RawArray` except that depending on the value of *lock* a process-safe synchronization wrapper may be returned instead of a raw ctypes array.
If *lock* is ``True`` (the default) then a new lock object is created to
synchronize access to the value. If *lock* is a
:class:`~multiprocessing.Lock` or :cl... | The same as :func:`RawArray` except that depending on the value of *lock* a process-safe synchronization wrapper may be returned instead of a raw ctypes array.
If *lock* is ``True`` (the default) then a new lock object is created to
synchronize access to the value. If *lock* is a
:class:`~multiprocessing.Lock` or :cl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cdcdfc94-e7fa-4dc5-8202-ce1de59e2ff3 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,501 | supabase-export-v2 | d5d1a8fbc963f737 | in the message. Blocks until there is something to receive. Raises :exc:`EOFError` if there is nothing left to receive and the other end was closed.
*buf* must be a writable :term:`bytes-like object`. If
*offset* is given then the message will be written into the buffer from
that position. Offset must be a non-negati... | trusted_official_docs | CPython Docs | in the message. Blocks until there is something to receive. Raises :exc:`EOFError` if there is nothing left to receive and the other end was closed.
*buf* must be a writable :term:`bytes-like object`. If
*offset* is given then the message will be written into the buffer from
that position. Offset must be a non-negati... | in the message. Blocks until there is something to receive. Raises :exc:`EOFError` if there is nothing left to receive and the other end was closed.
*buf* must be a writable :term:`bytes-like object`. If
*offset* is given then the message will be written into the buffer from
that position. Offset must be a non-negati... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ce1cebf2-f083-408b-9a2c-2eea467f4033 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,199 | supabase-export-v2 | df5bc82ea387d8ef | if __name__ == '__main__': parent_conn, child_conn = Pipe() p = Process(target=f, args=(child_conn,)) p.start() print(parent_conn.recv()) # prints "[42, None, 'hello']" p.join()
The two connection objects returned by :func:`Pipe` represent the two ends of
the pipe. Each connection object has :meth:`~Connection.send` a... | trusted_official_docs | CPython Docs | if __name__ == '__main__': parent_conn, child_conn = Pipe() p = Process(target=f, args=(child_conn,)) p.start() print(parent_conn.recv()) # prints "[42, None, 'hello']" p.join()
The two connection objects returned by :func:`Pipe` represent the two ends of
the pipe. Each connection object has :meth:`~Connection.send` a... | if __name__ == '__main__': parent_conn, child_conn = Pipe() p = Process(target=f, args=(child_conn,)) p.start() print(parent_conn.recv()) # prints "[42, None, 'hello']" p.join()
The two connection objects returned by :func:`Pipe` represent the two ends of
the pipe. Each connection object has :meth:`~Connection.send` a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ce7c75c6-e907-4a55-bb72-f27cdf626826 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,358 | supabase-export-v2 | 41dc8feac96a306d | Returns a pair ``(conn1, conn2)`` of :class:`~multiprocessing.connection.Connection` objects representing the ends of a pipe.
If *duplex* is ``True`` (the default) then the pipe is bidirectional. If
*duplex* is ``False`` then the pipe is unidirectional: ``conn1`` can only be
used for receiving messages and ``conn2`` ... | trusted_official_docs | CPython Docs | Returns a pair ``(conn1, conn2)`` of :class:`~multiprocessing.connection.Connection` objects representing the ends of a pipe.
If *duplex* is ``True`` (the default) then the pipe is bidirectional. If
*duplex* is ``False`` then the pipe is unidirectional: ``conn1`` can only be
used for receiving messages and ``conn2`` ... | Returns a pair ``(conn1, conn2)`` of :class:`~multiprocessing.connection.Connection` objects representing the ends of a pipe.
If *duplex* is ``True`` (the default) then the pipe is bidirectional. If
*duplex* is ``False`` then the pipe is unidirectional: ``conn1`` can only be
used for receiving messages and ``conn2`` ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cebd383c-77c8-4809-a588-f3a6319b6ea9 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,867 | supabase-export-v2 | b4c93bd3823a3dc4 | Receive a message, calculate the digest of the message using *authkey* as the key, and then send the digest back.
If a welcome message is not received, then
:exc:`~multiprocessing.AuthenticationError` is raised. | trusted_official_docs | CPython Docs | Receive a message, calculate the digest of the message using *authkey* as the key, and then send the digest back.
If a welcome message is not received, then
:exc:`~multiprocessing.AuthenticationError` is raised. | Receive a message, calculate the digest of the message using *authkey* as the key, and then send the digest back.
If a welcome message is not received, then
:exc:`~multiprocessing.AuthenticationError` is raised. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cf5e6288-2398-45aa-a5ec-287cee2f714d | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,137 | supabase-export-v2 | 784ef0088241dbc5 | [1, 4, 9]
The :mod:`!multiprocessing` module also introduces APIs which do not have
analogs in the :mod:`threading` module, like the ability to :meth:`terminate
<Process.terminate>`, :meth:`interrupt <Process.interrupt>` or :meth:`kill
<Process.kill>` a running process. | trusted_official_docs | CPython Docs | [1, 4, 9]
The :mod:`!multiprocessing` module also introduces APIs which do not have
analogs in the :mod:`threading` module, like the ability to :meth:`terminate
<Process.terminate>`, :meth:`interrupt <Process.interrupt>` or :meth:`kill
<Process.kill>` a running process. | [1, 4, 9]
The :mod:`!multiprocessing` module also introduces APIs which do not have
analogs in the :mod:`threading` module, like the ability to :meth:`terminate
<Process.terminate>`, :meth:`interrupt <Process.interrupt>` or :meth:`kill
<Process.kill>` a running process. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cf8bd8e5-49a9-4088-b2be-573137711835 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,814 | supabase-export-v2 | 662527b7a0ffc444 | it submits to the process pool as separate tasks. The (approximate) size of these chunks can be specified by setting *chunksize* to a positive integer.
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 ef... | trusted_official_docs | CPython Docs | it submits to the process pool as separate tasks. The (approximate) size of these chunks can be specified by setting *chunksize* to a positive integer.
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 ef... | it submits to the process pool as separate tasks. The (approximate) size of these chunks can be specified by setting *chunksize* to a positive integer.
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 ef... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d278521c-77f1-4239-8c3d-9246a3d24947 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,657 | supabase-export-v2 | 5139d33ce88315d3 | completes in the :meth:`shutdown` method. If the shutdown times out, the process is terminated. If terminating the process also times out, the process is killed.
.. versionchanged:: 3.11
Added the *shutdown_timeout* parameter. | trusted_official_docs | CPython Docs | completes in the :meth:`shutdown` method. If the shutdown times out, the process is terminated. If terminating the process also times out, the process is killed.
.. versionchanged:: 3.11
Added the *shutdown_timeout* parameter. | completes in the :meth:`shutdown` method. If the shutdown times out, the process is terminated. If terminating the process also times out, the process is killed.
.. versionchanged:: 3.11
Added the *shutdown_timeout* parameter. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d372fe93-4de7-415d-a835-f5afd9f182c3 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,656 | supabase-export-v2 | 2a3077ac1dc60cc3 | 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 details.
*shutdown_timeout* is a timeout in seconds used to wait until the process
used by the manager completes in the :meth:`shutdown` method. If the
shutdow... | trusted_official_docs | CPython Docs | 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 details.
*shutdown_timeout* is a timeout in seconds used to wait until the process
used by the manager completes in the :meth:`shutdown` method. If the
shutdow... | 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 details.
*shutdown_timeout* is a timeout in seconds used to wait until the process
used by the manager completes in the :meth:`shutdown` method. If the
shutdow... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d40a98c2-a559-49b2-bb43-b43ca7071833 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,677 | supabase-export-v2 | 4dda2e8dd54308ae | is not a key of this mapping or if the mapping is ``None`` then the object returned by the method will be copied by value.
*create_method* determines whether a method should be created with name
*typeid* which can be used to tell the server process to create a new
shared object and return a proxy for it. By default i... | trusted_official_docs | CPython Docs | is not a key of this mapping or if the mapping is ``None`` then the object returned by the method will be copied by value.
*create_method* determines whether a method should be created with name
*typeid* which can be used to tell the server process to create a new
shared object and return a proxy for it. By default i... | is not a key of this mapping or if the mapping is ``None`` then the object returned by the method will be copied by value.
*create_method* determines whether a method should be created with name
*typeid* which can be used to tell the server process to create a new
shared object and return a proxy for it. By default i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d438edaa-1400-41e6-9436-f0432131ca91 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,245 | supabase-export-v2 | 8ce1dbf7069ee1a6 | # exiting the 'with'-block has stopped the pool print("Now the pool is closed and no longer available")
Note that the methods of a pool should only ever be used by the
process which created it. | trusted_official_docs | CPython Docs | # exiting the 'with'-block has stopped the pool print("Now the pool is closed and no longer available")
Note that the methods of a pool should only ever be used by the
process which created it. | # exiting the 'with'-block has stopped the pool print("Now the pool is closed and no longer available")
Note that the methods of a pool should only ever be used by the
process which created it. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d529ddc5-b350-4337-aa09-229cee4fb503 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,752 | supabase-export-v2 | 88dd4f7537b39dcf | 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']
Similarly, dict and list proxies may be nested inside one another:: | trusted_official_docs | CPython Docs | 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']
Similarly, dict and list proxies may be nested inside one another:: | 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']
Similarly, dict and list proxies may be nested inside one another:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d67cfda4-6ca1-4eaa-8fd0-18ad481133f2 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,632 | supabase-export-v2 | e4a10ed99083b3ac | 4, 6) (c_short * 7)() RawArray(c_short, 7) RawArray('h', 7) (c_int * 3)(9, 2, 8) RawArray(c_int, (9, 2, 8)) RawArray('i', (9, 2, 8)) ==================== ========================== ===========================
Below is an example where a number of ctypes objects are modified by a child
process:: | trusted_official_docs | CPython Docs | 4, 6) (c_short * 7)() RawArray(c_short, 7) RawArray('h', 7) (c_int * 3)(9, 2, 8) RawArray(c_int, (9, 2, 8)) RawArray('i', (9, 2, 8)) ==================== ========================== ===========================
Below is an example where a number of ctypes objects are modified by a child
process:: | 4, 6) (c_short * 7)() RawArray(c_short, 7) RawArray('h', 7) (c_int * 3)(9, 2, 8) RawArray(c_int, (9, 2, 8)) RawArray('i', (9, 2, 8)) ==================== ========================== ===========================
Below is an example where a number of ctypes objects are modified by a child
process:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d74dc45a-48f9-49e1-96a6-0d6c5371a1e7 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,544 | supabase-export-v2 | 6198286fe3f9e42b | Acquire a lock, blocking or non-blocking.
With the *block* argument set to ``True`` (the default), the method call
will block until the lock is in an unlocked state, then set it to locked
and return ``True``. Note that the name of this first argument differs
from that in :meth:`threading.Lock.acquire`. | trusted_official_docs | CPython Docs | Acquire a lock, blocking or non-blocking.
With the *block* argument set to ``True`` (the default), the method call
will block until the lock is in an unlocked state, then set it to locked
and return ``True``. Note that the name of this first argument differs
from that in :meth:`threading.Lock.acquire`. | Acquire a lock, blocking or non-blocking.
With the *block* argument set to ``True`` (the default), the method call
will block until the lock is in an unlocked state, then set it to locked
and return ``True``. Note that the name of this first argument differs
from that in :meth:`threading.Lock.acquire`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d758e212-85ce-4431-afeb-672e0bb77483 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 7,008 | supabase-export-v2 | ce96394b6d4d5945 | Global variables
Bear in mind that if code run in a child process tries to access a global
variable, then the 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. | trusted_official_docs | CPython Docs | Global variables
Bear in mind that if code run in a child process tries to access a global
variable, then the 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. | Global variables
Bear in mind that if code run in a child process tries to access a global
variable, then the 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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d8e3badb-d5dc-4c88-8ad3-12c887ea18c9 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,347 | supabase-export-v2 | f75b41aa1702f626 | but should not cause any practical difficulties -- if they really bother you then you can instead use a queue created with a :ref:`manager <multiprocessing-managers>`.
(1) After putting an object on an empty queue there may be an
infinitesimal delay before the queue's :meth:`~Queue.empty`
method returns :const:`False... | trusted_official_docs | CPython Docs | but should not cause any practical difficulties -- if they really bother you then you can instead use a queue created with a :ref:`manager <multiprocessing-managers>`.
(1) After putting an object on an empty queue there may be an
infinitesimal delay before the queue's :meth:`~Queue.empty`
method returns :const:`False... | but should not cause any practical difficulties -- if they really bother you then you can instead use a queue created with a :ref:`manager <multiprocessing-managers>`.
(1) After putting an object on an empty queue there may be an
infinitesimal delay before the queue's :meth:`~Queue.empty`
method returns :const:`False... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
da09570a-c6a3-4b79-b2d2-f7a32632ed4b | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,258 | supabase-export-v2 | 5c51fdda92aca1e8 | .. class:: Process(group=None, target=None, name=None, args=(), kwargs={}, \ *, daemon=None)
Process objects represent activity that is run in a separate process. The
:class:`Process` class has equivalents of all the methods of
:class:`threading.Thread`. | trusted_official_docs | CPython Docs | .. class:: Process(group=None, target=None, name=None, args=(), kwargs={}, \ *, daemon=None)
Process objects represent activity that is run in a separate process. The
:class:`Process` class has equivalents of all the methods of
:class:`threading.Thread`. | .. class:: Process(group=None, target=None, name=None, args=(), kwargs={}, \ *, daemon=None)
Process objects represent activity that is run in a separate process. The
:class:`Process` class has equivalents of all the methods of
:class:`threading.Thread`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
db3ec44c-fc86-4b50-901d-1db97f5015cc | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,652 | supabase-export-v2 | fda98e342e3084a2 | Once created one should call :meth:`start` or ``get_server().serve_forever()`` to ensure that the manager object refers to a started manager process.
*address* is the address on which the manager process listens for new
connections. If *address* is ``None`` then an arbitrary one is chosen. | trusted_official_docs | CPython Docs | Once created one should call :meth:`start` or ``get_server().serve_forever()`` to ensure that the manager object refers to a started manager process.
*address* is the address on which the manager process listens for new
connections. If *address* is ``None`` then an arbitrary one is chosen. | Once created one should call :meth:`start` or ``get_server().serve_forever()`` to ensure that the manager object refers to a started manager process.
*address* is the address on which the manager process listens for new
connections. If *address* is ``None`` then an arbitrary one is chosen. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dbe68704-b596-494d-9e5b-5e71e052ee27 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,442 | supabase-export-v2 | 3adaebd8b68c675c | If the ``freeze_support()`` line is omitted then trying to run the frozen executable will raise :exc:`RuntimeError`.
Calling ``freeze_support()`` has no effect when the start method is not
*spawn*. In addition, if the module is being run normally by the Python
interpreter (the program has not been frozen), then ``fre... | trusted_official_docs | CPython Docs | If the ``freeze_support()`` line is omitted then trying to run the frozen executable will raise :exc:`RuntimeError`.
Calling ``freeze_support()`` has no effect when the start method is not
*spawn*. In addition, if the module is being run normally by the Python
interpreter (the program has not been frozen), then ``fre... | If the ``freeze_support()`` line is omitted then trying to run the frozen executable will raise :exc:`RuntimeError`.
Calling ``freeze_support()`` has no effect when the start method is not
*spawn*. In addition, if the module is being run normally by the Python
interpreter (the program has not been frozen), then ``fre... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dc3c5df9-b2ae-4d6e-b398-97dd5279e5e2 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,374 | supabase-export-v2 | 6fe6f837b54a347d | .. method:: put(obj[, block[, timeout]])
Put obj into the queue. If the optional argument *block* is ``True``
(the default) and *timeout* is ``None`` (the default), block if necessary until
a free slot is available. If *timeout* is a positive number, it blocks at
most *timeout* seconds and raises the :exc:`queue.Ful... | trusted_official_docs | CPython Docs | .. method:: put(obj[, block[, timeout]])
Put obj into the queue. If the optional argument *block* is ``True``
(the default) and *timeout* is ``None`` (the default), block if necessary until
a free slot is available. If *timeout* is a positive number, it blocks at
most *timeout* seconds and raises the :exc:`queue.Ful... | .. method:: put(obj[, block[, timeout]])
Put obj into the queue. If the optional argument *block* is ``True``
(the default) and *timeout* is ``None`` (the default), block if necessary until
a free slot is available. If *timeout* is a positive number, it blocks at
most *timeout* seconds and raises the :exc:`queue.Ful... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dd536798-5a08-4c70-a90d-62e990beb620 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,342 | supabase-export-v2 | e11c8e711df8bbe7 | put into them using :mod:`pickle`. The object returned by the get method is a re-created object that does not share memory with the original object.
Note that one can also create a shared queue by using a manager object -- see
:ref:`multiprocessing-managers`. | trusted_official_docs | CPython Docs | put into them using :mod:`pickle`. The object returned by the get method is a re-created object that does not share memory with the original object.
Note that one can also create a shared queue by using a manager object -- see
:ref:`multiprocessing-managers`. | put into them using :mod:`pickle`. The object returned by the get method is a re-created object that does not share memory with the original object.
Note that one can also create a shared queue by using a manager object -- see
:ref:`multiprocessing-managers`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dd79221e-7e00-4158-80bb-8b003075c12c | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,317 | supabase-export-v2 | 21cf499227911658 | .. warning::
If this method is used when the associated process is using a pipe or
queue then the pipe or queue is liable to become corrupted and may
become unusable by other process. Similarly, if the process has
acquired a lock or semaphore etc. then terminating it is liable to
cause other processes to deadlock. | trusted_official_docs | CPython Docs | .. warning::
If this method is used when the associated process is using a pipe or
queue then the pipe or queue is liable to become corrupted and may
become unusable by other process. Similarly, if the process has
acquired a lock or semaphore etc. then terminating it is liable to
cause other processes to deadlock. | .. warning::
If this method is used when the associated process is using a pipe or
queue then the pipe or queue is liable to become corrupted and may
become unusable by other process. Similarly, if the process has
acquired a lock or semaphore etc. then terminating it is liable to
cause other processes to deadlock. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dd7e13d9-1372-416d-8403-ca0b346d1b9b | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,350 | supabase-export-v2 | 35de3dbce7293681 | .. warning::
If a process is killed using :meth:`Process.terminate` or :func:`os.kill`
while it is trying to use a :class:`Queue`, then the data in the queue is
likely to become corrupted. This may cause any other process to get an
exception when it tries to use the queue later on. | trusted_official_docs | CPython Docs | .. warning::
If a process is killed using :meth:`Process.terminate` or :func:`os.kill`
while it is trying to use a :class:`Queue`, then the data in the queue is
likely to become corrupted. This may cause any other process to get an
exception when it tries to use the queue later on. | .. warning::
If a process is killed using :meth:`Process.terminate` or :func:`os.kill`
while it is trying to use a :class:`Queue`, then the data in the queue is
likely to become corrupted. This may cause any other process to get an
exception when it tries to use the queue later on. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ddb77c3b-0abc-4afe-a70d-98c40999cc6f | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,178 | supabase-export-v2 | 81a2f45116838326 | :func:`set_start_method` should not be used more than once in the program.
Alternatively, you can use :func:`get_context` to obtain a context
object. Context objects have the same API as the multiprocessing
module, and allow one to use multiple start methods in the same
program. :: | trusted_official_docs | CPython Docs | :func:`set_start_method` should not be used more than once in the program.
Alternatively, you can use :func:`get_context` to obtain a context
object. Context objects have the same API as the multiprocessing
module, and allow one to use multiple start methods in the same
program. :: | :func:`set_start_method` should not be used more than once in the program.
Alternatively, you can use :func:`get_context` to obtain a context
object. Context objects have the same API as the multiprocessing
module, and allow one to use multiple start methods in the same
program. :: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
de904b47-de9f-4412-9f21-c5d8cb2bdc7c | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,498 | supabase-export-v2 | 1a27649c8380c63b | If *maxlength* is specified and the message is longer than *maxlength* then :exc:`OSError` is raised and the connection will no longer be readable.
.. versionchanged:: 3.3
This function used to raise :exc:`IOError`, which is now an
alias of :exc:`OSError`. | trusted_official_docs | CPython Docs | If *maxlength* is specified and the message is longer than *maxlength* then :exc:`OSError` is raised and the connection will no longer be readable.
.. versionchanged:: 3.3
This function used to raise :exc:`IOError`, which is now an
alias of :exc:`OSError`. | If *maxlength* is specified and the message is longer than *maxlength* then :exc:`OSError` is raised and the connection will no longer be readable.
.. versionchanged:: 3.3
This function used to raise :exc:`IOError`, which is now an
alias of :exc:`OSError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e119beb6-dc23-4c04-99a3-af3201c3fee1 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,726 | supabase-export-v2 | 449a18e9cc7eaf04 | Customized managers """""""""""""""""""
To create one's own manager, one creates a subclass of :class:`BaseManager` and
uses the :meth:`~BaseManager.register` classmethod to register new types or
callables with the manager class. For example:: | trusted_official_docs | CPython Docs | Customized managers """""""""""""""""""
To create one's own manager, one creates a subclass of :class:`BaseManager` and
uses the :meth:`~BaseManager.register` classmethod to register new types or
callables with the manager class. For example:: | Customized managers """""""""""""""""""
To create one's own manager, one creates a subclass of :class:`BaseManager` and
uses the :meth:`~BaseManager.register` classmethod to register new types or
callables with the manager class. For example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e3807bf1-bf89-49ac-b29a-86523ef61eb9 | CPython Docs | file://datasets/cpython/Doc/library/multiprocessing.rst | unknown | dabaa007-4d48-4185-8c2f-de72cec02891 | 6,653 | supabase-export-v2 | 10c67a573db167cb | *address* is the address on which the manager process listens for new connections. If *address* is ``None`` then an arbitrary one is chosen.
*authkey* is the authentication key which will be used to check the
validity of incoming connections to the server process. If
*authkey* is ``None`` then ``current_process().aut... | trusted_official_docs | CPython Docs | *address* is the address on which the manager process listens for new connections. If *address* is ``None`` then an arbitrary one is chosen.
*authkey* is the authentication key which will be used to check the
validity of incoming connections to the server process. If
*authkey* is ``None`` then ``current_process().aut... | *address* is the address on which the manager process listens for new connections. If *address* is ``None`` then an arbitrary one is chosen.
*authkey* is the authentication key which will be used to check the
validity of incoming connections to the server process. If
*authkey* is ``None`` then ``current_process().aut... | 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.