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
4bf03b0a-550f-4f0d-95e3-da79ddbe8fe0
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,380
supabase-export-v2
0aa61f96d2f9a203
that time. Otherwise (block is ``False``), return an item if one is immediately available, else raise the :exc:`queue.Empty` exception (*timeout* is ignored in that case). .. versionchanged:: 3.8 If the queue is closed, :exc:`ValueError` is raised instead of :exc:`OSError`.
trusted_official_docs
CPython Docs
that time. Otherwise (block is ``False``), return an item if one is immediately available, else raise the :exc:`queue.Empty` exception (*timeout* is ignored in that case). .. versionchanged:: 3.8 If the queue is closed, :exc:`ValueError` is raised instead of :exc:`OSError`.
that time. Otherwise (block is ``False``), return an item if one is immediately available, else raise the :exc:`queue.Empty` exception (*timeout* is ignored in that case). .. versionchanged:: 3.8 If the queue is closed, :exc:`ValueError` is raised instead of :exc:`OSError`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4c43420c-1cb6-4238-ba72-36de9f6fe443
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,310
supabase-export-v2
f5dad6ca63f72f31
Terminate the process. Works on POSIX using the :py:const:`~signal.SIGINT` signal. Behavior on Windows is undefined. By default, this terminates the child process by raising :exc:`KeyboardInterrupt`. This behavior can be altered by setting the respective signal handler in the child process :func:`signal.signal` for :p...
trusted_official_docs
CPython Docs
Terminate the process. Works on POSIX using the :py:const:`~signal.SIGINT` signal. Behavior on Windows is undefined. By default, this terminates the child process by raising :exc:`KeyboardInterrupt`. This behavior can be altered by setting the respective signal handler in the child process :func:`signal.signal` for :p...
Terminate the process. Works on POSIX using the :py:const:`~signal.SIGINT` signal. Behavior on Windows is undefined. By default, this terminates the child process by raising :exc:`KeyboardInterrupt`. This behavior can be altered by setting the respective signal handler in the child process :func:`signal.signal` for :p...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4ccf391d-0381-49b9-92fa-5233200f8f37
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,934
supabase-export-v2
99ae5177747298ba
Returns the logger used by :mod:`!multiprocessing`. If necessary, a new one will be created. When first created the logger has level :const:`logging.NOTSET` and no default handler. Messages sent to this logger will not by default propagate to the root logger.
trusted_official_docs
CPython Docs
Returns the logger used by :mod:`!multiprocessing`. If necessary, a new one will be created. When first created the logger has level :const:`logging.NOTSET` and no default handler. Messages sent to this logger will not by default propagate to the root logger.
Returns the logger used by :mod:`!multiprocessing`. If necessary, a new one will be created. When first created the logger has level :const:`logging.NOTSET` and no default handler. Messages sent to this logger will not by default propagate to the root logger.
python, official-docs, cpython, P0
Local_Trusted_Corpus
4d60b085-d8eb-4cf8-a680-34ac73493c53
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,506
supabase-export-v2
59431df56df2009d
.. doctest:: >>> from multiprocessing import Pipe >>> a, b = Pipe() >>> a.send([1, 'hello', None]) >>> b.recv() [1, 'hello', None] >>> b.send_bytes(b'thank you') >>> a.recv_bytes() b'thank you' >>> import array >>> arr1 = array.array('i', range(5)) >>> arr2 = array.array('i', [0] * 10) >>> a.send_bytes(arr1)...
trusted_official_docs
CPython Docs
.. doctest:: >>> from multiprocessing import Pipe >>> a, b = Pipe() >>> a.send([1, 'hello', None]) >>> b.recv() [1, 'hello', None] >>> b.send_bytes(b'thank you') >>> a.recv_bytes() b'thank you' >>> import array >>> arr1 = array.array('i', range(5)) >>> arr2 = array.array('i', [0] * 10) >>> a.send_bytes(arr1)...
.. doctest:: >>> from multiprocessing import Pipe >>> a, b = Pipe() >>> a.send([1, 'hello', None]) >>> b.recv() [1, 'hello', None] >>> b.send_bytes(b'thank you') >>> a.recv_bytes() b'thank you' >>> import array >>> arr1 = array.array('i', range(5)) >>> arr2 = array.array('i', [0] * 10) >>> a.send_bytes(arr1)...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4e6f6864-1433-42a1-9f55-8db23230dc6f
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,915
supabase-export-v2
6b62bb77dc9d02cb
if __name__ == '__main__': readers = [] for i in range(4): r, w = Pipe(duplex=False) readers.append(r) p = Process(target=foo, args=(w,)) p.start() # We close the writable end of the pipe now to be sure that # p is the only process which owns a handle for it. This # ensures that when p closes its handle for the ...
trusted_official_docs
CPython Docs
if __name__ == '__main__': readers = [] for i in range(4): r, w = Pipe(duplex=False) readers.append(r) p = Process(target=foo, args=(w,)) p.start() # We close the writable end of the pipe now to be sure that # p is the only process which owns a handle for it. This # ensures that when p closes its handle for the ...
if __name__ == '__main__': readers = [] for i in range(4): r, w = Pipe(duplex=False) readers.append(r) p = Process(target=foo, args=(w,)) p.start() # We close the writable end of the pipe now to be sure that # p is the only process which owns a handle for it. This # ensures that when p closes its handle for the ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
4e70f23e-eb64-4f57-a197-c10cfff4ba6a
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,338
supabase-export-v2
72f98aabbcd2e1e3
When using multiple processes, one generally uses message passing for communication between processes and avoids having to use any synchronization primitives like locks. For passing messages one can use :func:`Pipe` (for a connection between two processes) or a queue (which allows multiple producers and consumers).
trusted_official_docs
CPython Docs
When using multiple processes, one generally uses message passing for communication between processes and avoids having to use any synchronization primitives like locks. For passing messages one can use :func:`Pipe` (for a connection between two processes) or a queue (which allows multiple producers and consumers).
When using multiple processes, one generally uses message passing for communication between processes and avoids having to use any synchronization primitives like locks. For passing messages one can use :func:`Pipe` (for a connection between two processes) or a queue (which allows multiple producers and consumers).
python, official-docs, cpython, P0
Local_Trusted_Corpus
51576ae6-4cfd-4481-ba07-3af9cbd9c978
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,186
supabase-export-v2
50174ea375bd1b4a
executables (i.e., binaries produced by packages like **PyInstaller** and **cx_Freeze**) on POSIX systems. The ``'fork'`` start method may work if code does not use threads. Exchanging objects between processes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
trusted_official_docs
CPython Docs
executables (i.e., binaries produced by packages like **PyInstaller** and **cx_Freeze**) on POSIX systems. The ``'fork'`` start method may work if code does not use threads. Exchanging objects between processes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
executables (i.e., binaries produced by packages like **PyInstaller** and **cx_Freeze**) on POSIX systems. The ``'fork'`` start method may work if code does not use threads. Exchanging objects between processes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
python, official-docs, cpython, P0
Local_Trusted_Corpus
52274b12-111e-4d1a-9c3d-c32e9077ad41
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,314
supabase-export-v2
d25839818016afce
.. method:: terminate() Terminate the process. On POSIX this is done using the :py:const:`~signal.SIGTERM` signal; on Windows :c:func:`!TerminateProcess` is used. Note that exit handlers and finally clauses, etc., will not be executed.
trusted_official_docs
CPython Docs
.. method:: terminate() Terminate the process. On POSIX this is done using the :py:const:`~signal.SIGTERM` signal; on Windows :c:func:`!TerminateProcess` is used. Note that exit handlers and finally clauses, etc., will not be executed.
.. method:: terminate() Terminate the process. On POSIX this is done using the :py:const:`~signal.SIGTERM` signal; on Windows :c:func:`!TerminateProcess` is used. Note that exit handlers and finally clauses, etc., will not be executed.
python, official-docs, cpython, P0
Local_Trusted_Corpus
52313918-0e5a-4556-b801-22e7d3606dfd
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,266
supabase-export-v2
5698f41c615883df
Example of this uncatchable error from the child:: >>> import multiprocessing as mp >>> def knigit(): ... print("Ni!") ... >>> process = mp.Process(target=knigit) >>> process.start() >>> Traceback (most recent call last): File ".../multiprocessing/spawn.py", line ..., in spawn_main File ".../multiprocessing/spaw...
trusted_official_docs
CPython Docs
Example of this uncatchable error from the child:: >>> import multiprocessing as mp >>> def knigit(): ... print("Ni!") ... >>> process = mp.Process(target=knigit) >>> process.start() >>> Traceback (most recent call last): File ".../multiprocessing/spawn.py", line ..., in spawn_main File ".../multiprocessing/spaw...
Example of this uncatchable error from the child:: >>> import multiprocessing as mp >>> def knigit(): ... print("Ni!") ... >>> process = mp.Process(target=knigit) >>> process.start() >>> Traceback (most recent call last): File ".../multiprocessing/spawn.py", line ..., in spawn_main File ".../multiprocessing/spaw...
python, official-docs, cpython, P0
Local_Trusted_Corpus
524632aa-4bb1-4267-a92f-49331d6de18d
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,981
supabase-export-v2
340b85b5250e5869
if __name__ == '__main__': queue = Queue() p = Process(target=f, args=(queue,)) p.start() p.join() # this deadlocks obj = queue.get() A fix here would be to swap the last two lines (or simply remove the ``p.join()`` line).
trusted_official_docs
CPython Docs
if __name__ == '__main__': queue = Queue() p = Process(target=f, args=(queue,)) p.start() p.join() # this deadlocks obj = queue.get() A fix here would be to swap the last two lines (or simply remove the ``p.join()`` line).
if __name__ == '__main__': queue = Queue() p = Process(target=f, args=(queue,)) p.start() p.join() # this deadlocks obj = queue.get() A fix here would be to swap the last two lines (or simply remove the ``p.join()`` line).
python, official-docs, cpython, P0
Local_Trusted_Corpus
54ba8c60-b4bd-419a-a59e-687523970eb9
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,278
supabase-export-v2
c059825b56b8259e
.. method:: join([timeout]) If the optional argument *timeout* is ``None`` (the default), the method blocks until the process whose :meth:`join` method is called terminates. If *timeout* is a positive number, it blocks at most *timeout* seconds. Note that the method returns ``None`` if its process terminates or if the...
trusted_official_docs
CPython Docs
.. method:: join([timeout]) If the optional argument *timeout* is ``None`` (the default), the method blocks until the process whose :meth:`join` method is called terminates. If *timeout* is a positive number, it blocks at most *timeout* seconds. Note that the method returns ``None`` if its process terminates or if the...
.. method:: join([timeout]) If the optional argument *timeout* is ``None`` (the default), the method blocks until the process whose :meth:`join` method is called terminates. If *timeout* is a positive number, it blocks at most *timeout* seconds. Note that the method returns ``None`` if its process terminates or if the...
python, official-docs, cpython, P0
Local_Trusted_Corpus
54f24f33-c621-42e0-8b72-99d22a5b7623
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,389
supabase-export-v2
94c3217722bde69e
.. method:: join_thread() Join the background thread. This can only be used 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.
trusted_official_docs
CPython Docs
.. method:: join_thread() Join the background thread. This can only be used 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.
.. method:: join_thread() Join the background thread. This can only be used 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.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5501380b-86c4-4f5e-bb3a-7dd49bd2db6f
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,232
supabase-export-v2
aa54f99c66fe5c7c
Using a pool of workers ^^^^^^^^^^^^^^^^^^^^^^^ The :class:`~multiprocessing.pool.Pool` class represents a pool of worker processes. It has methods which allows tasks to be offloaded to the worker processes in a few different ways.
trusted_official_docs
CPython Docs
Using a pool of workers ^^^^^^^^^^^^^^^^^^^^^^^ The :class:`~multiprocessing.pool.Pool` class represents a pool of worker processes. It has methods which allows tasks to be offloaded to the worker processes in a few different ways.
Using a pool of workers ^^^^^^^^^^^^^^^^^^^^^^^ The :class:`~multiprocessing.pool.Pool` class represents a pool of worker processes. It has methods which allows tasks to be offloaded to the worker processes in a few different ways.
python, official-docs, cpython, P0
Local_Trusted_Corpus
55239142-0e85-47fd-8ee5-842542040a8d
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,209
supabase-export-v2
a74c7f1c88663bb0
Sharing state between processes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ As mentioned above, when doing concurrent programming it is usually best to avoid using shared state as far as possible. This is particularly true when using multiple processes.
trusted_official_docs
CPython Docs
Sharing state between processes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ As mentioned above, when doing concurrent programming it is usually best to avoid using shared state as far as possible. This is particularly true when using multiple processes.
Sharing state between processes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ As mentioned above, when doing concurrent programming it is usually best to avoid using shared state as far as possible. This is particularly true when using multiple processes.
python, official-docs, cpython, P0
Local_Trusted_Corpus
561461b9-9101-482c-8393-cc87485bd28e
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,231
supabase-export-v2
f33d64d348f80229
object types. Also, a single manager can be shared by processes on different computers over a network. They are, however, slower than using shared memory. Using a pool of workers ^^^^^^^^^^^^^^^^^^^^^^^
trusted_official_docs
CPython Docs
object types. Also, a single manager can be shared by processes on different computers over a network. They are, however, slower than using shared memory. Using a pool of workers ^^^^^^^^^^^^^^^^^^^^^^^
object types. Also, a single manager can be shared by processes on different computers over a network. They are, however, slower than using shared memory. Using a pool of workers ^^^^^^^^^^^^^^^^^^^^^^^
python, official-docs, cpython, P0
Local_Trusted_Corpus
596d2863-dfdd-40de-8e35-f1f3bb445dc8
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,871
supabase-export-v2
b0e38cac763dbb2a
connection is determined by *family* argument, but this can generally be omitted since it can usually be inferred from the format of *address*. (See :ref:`multiprocessing-address-formats`) 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 authentica...
trusted_official_docs
CPython Docs
connection is determined by *family* argument, but this can generally be omitted since it can usually be inferred from the format of *address*. (See :ref:`multiprocessing-address-formats`) 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 authentica...
connection is determined by *family* argument, but this can generally be omitted since it can usually be inferred from the format of *address*. (See :ref:`multiprocessing-address-formats`) 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 authentica...
python, official-docs, cpython, P0
Local_Trusted_Corpus
59e2c0e2-678c-4c73-8904-6377d8417a17
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,414
supabase-export-v2
c80e99d0404c8031
will resume when all items have been processed (meaning that a :meth:`task_done` call was received for every item that had been :meth:`~Queue.put` into the queue). Raises a :exc:`ValueError` if called more times than there were items placed in the queue.
trusted_official_docs
CPython Docs
will resume when all items have been processed (meaning that a :meth:`task_done` call was received for every item that had been :meth:`~Queue.put` into the queue). Raises a :exc:`ValueError` if called more times than there were items placed in the queue.
will resume when all items have been processed (meaning that a :meth:`task_done` call was received for every item that had been :meth:`~Queue.put` into the queue). Raises a :exc:`ValueError` if called more times than there were items placed in the queue.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5ab86060-2b87-4205-80c7-bc76cf58ab6e
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,491
supabase-export-v2
e88f20e750608ebb
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. Note that multiple connection objects may be polled at once by using :func:`multiprocessing.connection.wait`.
trusted_official_docs
CPython Docs
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. Note that multiple connection objects may be polled at once by using :func:`multiprocessing.connection.wait`.
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. Note that multiple connection objects may be polled at once by using :func:`multiprocessing.connection.wait`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5bbadd8f-4d4c-4352-96c4-8e754895294d
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,920
supabase-export-v2
eb290fc6b55ac3cc
* An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where *hostname* is a string and *port* is an integer. * An ``'AF_UNIX'`` address is a string representing a filename on the filesystem.
trusted_official_docs
CPython Docs
* An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where *hostname* is a string and *port* is an integer. * An ``'AF_UNIX'`` address is a string representing a filename on the filesystem.
* An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where *hostname* is a string and *port* is an integer. * An ``'AF_UNIX'`` address is a string representing a filename on the filesystem.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5cbe10f2-b89e-4113-8160-79c670edda41
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,949
supabase-export-v2
6426a17c0f0931ee
*processes* is the number of worker threads to use. If *processes* is ``None`` then the number returned by :func:`os.process_cpu_count` is used. If *initializer* is not ``None`` then each worker process will call ``initializer(*initargs)`` when it starts.
trusted_official_docs
CPython Docs
*processes* is the number of worker threads to use. If *processes* is ``None`` then the number returned by :func:`os.process_cpu_count` is used. If *initializer* is not ``None`` then each worker process will call ``initializer(*initargs)`` when it starts.
*processes* is the number of worker threads to use. If *processes* is ``None`` then the number returned by :func:`os.process_cpu_count` is used. If *initializer* is not ``None`` then each worker process will call ``initializer(*initargs)`` when it starts.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5d0e09a2-9246-445c-8195-54fb303c1f69
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,167
supabase-export-v2
dd81e27e913660ef
.. versionchanged:: 3.14 This became the default start method on POSIX platforms. .. versionchanged:: 3.4 *spawn* added on all POSIX platforms, and *forkserver* added for some POSIX platforms. Child processes no longer inherit all of the parents inheritable handles on Windows.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.14 This became the default start method on POSIX platforms. .. versionchanged:: 3.4 *spawn* added on all POSIX platforms, and *forkserver* added for some POSIX platforms. Child processes no longer inherit all of the parents inheritable handles on Windows.
.. versionchanged:: 3.14 This became the default start method on POSIX platforms. .. versionchanged:: 3.4 *spawn* added on all POSIX platforms, and *forkserver* added for some POSIX platforms. Child processes no longer inherit all of the parents inheritable handles on Windows.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5d708398-d0a5-47b4-be4e-8bd98f925759
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,183
supabase-export-v2
bb582c2079d63795
for a different context. In particular, locks created using the *fork* context cannot be passed to processes started using the *spawn* or *forkserver* start methods. Libraries using :mod:`!multiprocessing` or :class:`~concurrent.futures.ProcessPoolExecutor` should be designed to allow their users to provide their own m...
trusted_official_docs
CPython Docs
for a different context. In particular, locks created using the *fork* context cannot be passed to processes started using the *spawn* or *forkserver* start methods. Libraries using :mod:`!multiprocessing` or :class:`~concurrent.futures.ProcessPoolExecutor` should be designed to allow their users to provide their own m...
for a different context. In particular, locks created using the *fork* context cannot be passed to processes started using the *spawn* or *forkserver* start methods. Libraries using :mod:`!multiprocessing` or :class:`~concurrent.futures.ProcessPoolExecutor` should be designed to allow their users to provide their own m...
python, official-docs, cpython, P0
Local_Trusted_Corpus
5d76d2bd-f1ef-4d2a-8816-ed65c85929cf
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,810
supabase-export-v2
4c55e5d0e025469e
then it should be a callable which accepts a single argument. If the target function fails, then the *error_callback* is called with the exception instance. Callbacks should complete immediately since otherwise the thread which handles the results will get blocked.
trusted_official_docs
CPython Docs
then it should be a callable which accepts a single argument. If the target function fails, then the *error_callback* is called with the exception instance. Callbacks should complete immediately since otherwise the thread which handles the results will get blocked.
then it should be a callable which accepts a single argument. If the target function fails, then the *error_callback* is called with the exception instance. Callbacks should complete immediately since otherwise the thread which handles the results will get blocked.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5db49d9f-fc6c-452c-b165-e12b28867eb5
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,771
supabase-export-v2
8ca3a8db0ec786cd
in the manager's process. The returned value will be a copy of the result of the call or a proxy to a new shared object -- see documentation for the *method_to_typeid* argument of :meth:`BaseManager.register`.
trusted_official_docs
CPython Docs
in the manager's process. The returned value will be a copy of the result of the call or a proxy to a new shared object -- see documentation for the *method_to_typeid* argument of :meth:`BaseManager.register`.
in the manager's process. The returned value will be a copy of the result of the call or a proxy to a new shared object -- see documentation for the *method_to_typeid* argument of :meth:`BaseManager.register`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5ee4c369-0812-4ba6-b73e-4d1410f7e047
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,471
supabase-export-v2
8d1b48b9293b3650
then the start method is set to ``None``. If *method* is ``None`` and *force* is ``False`` then the context is set to the default context. Note that this should be called at most once, and it should be protected inside the ``if __name__ == '__main__'`` clause of the main module.
trusted_official_docs
CPython Docs
then the start method is set to ``None``. If *method* is ``None`` and *force* is ``False`` then the context is set to the default context. Note that this should be called at most once, and it should be protected inside the ``if __name__ == '__main__'`` clause of the main module.
then the start method is set to ``None``. If *method* is ``None`` and *force* is ``False`` then the context is set to the default context. Note that this should be called at most once, and it should be protected inside the ``if __name__ == '__main__'`` clause of the main module.
python, official-docs, cpython, P0
Local_Trusted_Corpus
5f28c262-6a37-4799-a6ee-8db903bdc298
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,193
supabase-export-v2
47b92e9564981ffa
if __name__ == '__main__': q = Queue() p = Process(target=f, args=(q,)) p.start() print(q.get()) # prints "[42, None, 'hello']" p.join() Queues are thread and process safe. Any object put into a :mod:`!multiprocessing` queue will be serialized.
trusted_official_docs
CPython Docs
if __name__ == '__main__': q = Queue() p = Process(target=f, args=(q,)) p.start() print(q.get()) # prints "[42, None, 'hello']" p.join() Queues are thread and process safe. Any object put into a :mod:`!multiprocessing` queue will be serialized.
if __name__ == '__main__': q = Queue() p = Process(target=f, args=(q,)) p.start() print(q.get()) # prints "[42, None, 'hello']" p.join() Queues are thread and process safe. Any object put into a :mod:`!multiprocessing` queue will be serialized.
python, official-docs, cpython, P0
Local_Trusted_Corpus
60254680-9d22-4db2-bcfe-72e88fa0be91
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,596
supabase-export-v2
22cd9be61a134d5f
If *lock* is ``False`` then access to the returned object will not be automatically protected by a lock, so it will not necessarily be "process-safe". Note that *lock* is a keyword only argument.
trusted_official_docs
CPython Docs
If *lock* is ``False`` then access to the returned object will not be automatically protected by a lock, so it will not necessarily be "process-safe". Note that *lock* is a keyword only argument.
If *lock* is ``False`` then access to the returned object will not be automatically protected by a lock, so it will not necessarily be "process-safe". Note that *lock* is a keyword only argument.
python, official-docs, cpython, P0
Local_Trusted_Corpus
60d2c18f-8133-462a-ab49-89aab3f1d1b7
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,672
supabase-export-v2
b6bc1193962c6cba
A classmethod which can be used for registering a type or callable with the manager class. *typeid* is a "type identifier" which is used to identify a particular type of shared object. This must be a string.
trusted_official_docs
CPython Docs
A classmethod which can be used for registering a type or callable with the manager class. *typeid* is a "type identifier" which is used to identify a particular type of shared object. This must be a string.
A classmethod which can be used for registering a type or callable with the manager class. *typeid* is a "type identifier" which is used to identify a particular type of shared object. This must be a string.
python, official-docs, cpython, P0
Local_Trusted_Corpus
618d366a-6029-46e0-90d9-9f7f4722f797
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,157
supabase-export-v2
4b87c63de7e92f61
and handles from the parent process will not be inherited. Starting a process using this method is rather slow compared to using *fork* or *forkserver*. Available on POSIX and Windows platforms. The default on Windows and macOS.
trusted_official_docs
CPython Docs
and handles from the parent process will not be inherited. Starting a process using this method is rather slow compared to using *fork* or *forkserver*. Available on POSIX and Windows platforms. The default on Windows and macOS.
and handles from the parent process will not be inherited. Starting a process using this method is rather slow compared to using *fork* or *forkserver*. Available on POSIX and Windows platforms. The default on Windows and macOS.
python, official-docs, cpython, P0
Local_Trusted_Corpus
619e0041-3856-4cf3-8091-77e571feb69d
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,977
supabase-export-v2
a136a4d4ababda02
Otherwise you cannot be sure that processes which have put items on the queue will terminate. Remember also that non-daemonic processes will be joined automatically. An example which will deadlock is the following::
trusted_official_docs
CPython Docs
Otherwise you cannot be sure that processes which have put items on the queue will terminate. Remember also that non-daemonic processes will be joined automatically. An example which will deadlock is the following::
Otherwise you cannot be sure that processes which have put items on the queue will terminate. Remember also that non-daemonic processes will be joined automatically. An example which will deadlock is the following::
python, official-docs, cpython, P0
Local_Trusted_Corpus
633d5fb3-088c-48e9-8aca-29ca59ea22e1
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,795
supabase-export-v2
5aee6f33ed1ba282
worker process, to enable unused resources to be freed. The default *maxtasksperchild* is ``None``, which means worker processes will live as long as the pool. *context* can be used to specify the context used for starting the worker processes. Usually a pool is created using the function :func:`multiprocessing.Pool`...
trusted_official_docs
CPython Docs
worker process, to enable unused resources to be freed. The default *maxtasksperchild* is ``None``, which means worker processes will live as long as the pool. *context* can be used to specify the context used for starting the worker processes. Usually a pool is created using the function :func:`multiprocessing.Pool`...
worker process, to enable unused resources to be freed. The default *maxtasksperchild* is ``None``, which means worker processes will live as long as the pool. *context* can be used to specify the context used for starting the worker processes. Usually a pool is created using the function :func:`multiprocessing.Pool`...
python, official-docs, cpython, P0
Local_Trusted_Corpus
636b0376-7b6b-4838-967a-bff2195f671c
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,448
supabase-export-v2
ff933acc75ac9762
Return a context object which has the same attributes as the :mod:`!multiprocessing` module. If *method* is ``None`` then the default context is returned. Note that if the global start method has not been set, this will set it to the system default See :ref:`global-start-method` for more details. Otherwise *method* s...
trusted_official_docs
CPython Docs
Return a context object which has the same attributes as the :mod:`!multiprocessing` module. If *method* is ``None`` then the default context is returned. Note that if the global start method has not been set, this will set it to the system default See :ref:`global-start-method` for more details. Otherwise *method* s...
Return a context object which has the same attributes as the :mod:`!multiprocessing` module. If *method* is ``None`` then the default context is returned. Note that if the global start method has not been set, this will set it to the system default See :ref:`global-start-method` for more details. Otherwise *method* s...
python, official-docs, cpython, P0
Local_Trusted_Corpus
644eafab-1fc8-40f4-afbb-2bb6e7f1eb4f
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,644
supabase-export-v2
ae4864662d66ba11
Managers ^^^^^^^^ Managers provide a way to create data which can be shared between different processes, including sharing over a network between processes running on different machines. A manager object controls a server process which manages *shared objects*. Other processes can access the shared objects by using pro...
trusted_official_docs
CPython Docs
Managers ^^^^^^^^ Managers provide a way to create data which can be shared between different processes, including sharing over a network between processes running on different machines. A manager object controls a server process which manages *shared objects*. Other processes can access the shared objects by using pro...
Managers ^^^^^^^^ Managers provide a way to create data which can be shared between different processes, including sharing over a network between processes running on different machines. A manager object controls a server process which manages *shared objects*. Other processes can access the shared objects by using pro...
python, official-docs, cpython, P0
Local_Trusted_Corpus
645c8b36-b057-45c7-9f18-75b56b3a7e11
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,331
supabase-export-v2
fdcd6a02ea574be5
Exception raised by :meth:`Connection.recv_bytes_into` when the supplied buffer object is too small for the message read. If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will give the message as a byte string.
trusted_official_docs
CPython Docs
Exception raised by :meth:`Connection.recv_bytes_into` when the supplied buffer object is too small for the message read. If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will give the message as a byte string.
Exception raised by :meth:`Connection.recv_bytes_into` when the supplied buffer object is too small for the message read. If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will give the message as a byte string.
python, official-docs, cpython, P0
Local_Trusted_Corpus
64afffd4-ad1a-4cd8-9b17-ca1f60c0063f
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,633
supabase-export-v2
754ab3d387b6f9fd
Below is an example where a number of ctypes objects are modified by a child process:: from multiprocessing import Process, Lock from multiprocessing.sharedctypes import Value, Array from ctypes import Structure, c_double
trusted_official_docs
CPython Docs
Below is an example where a number of ctypes objects are modified by a child process:: from multiprocessing import Process, Lock from multiprocessing.sharedctypes import Value, Array from ctypes import Structure, c_double
Below is an example where a number of ctypes objects are modified by a child process:: from multiprocessing import Process, Lock from multiprocessing.sharedctypes import Value, Array from ctypes import Structure, c_double
python, official-docs, cpython, P0
Local_Trusted_Corpus
673c5120-2c91-4dfc-bfa8-a86e9dcaf6eb
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,516
supabase-export-v2
3411722e9eb80db5
Generally synchronization primitives are not as necessary in a multiprocess program as they are in a multithreaded program. See the documentation for :mod:`threading` module. Note that one can also create synchronization primitives by using a manager object -- see :ref:`multiprocessing-managers`.
trusted_official_docs
CPython Docs
Generally synchronization primitives are not as necessary in a multiprocess program as they are in a multithreaded program. See the documentation for :mod:`threading` module. Note that one can also create synchronization primitives by using a manager object -- see :ref:`multiprocessing-managers`.
Generally synchronization primitives are not as necessary in a multiprocess program as they are in a multithreaded program. See the documentation for :mod:`threading` module. Note that one can also create synchronization primitives by using a manager object -- see :ref:`multiprocessing-managers`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
67b064e3-e961-4b33-a61d-8610ba4b2dcd
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,306
supabase-export-v2
f98afe034124bff8
A numeric handle of a system object which will become "ready" when the process ends. You can use this value if you want to wait on several events at once using :func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join` is simpler.
trusted_official_docs
CPython Docs
A numeric handle of a system object which will become "ready" when the process ends. You can use this value if you want to wait on several events at once using :func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join` is simpler.
A numeric handle of a system object which will become "ready" when the process ends. You can use this value if you want to wait on several events at once using :func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join` is simpler.
python, official-docs, cpython, P0
Local_Trusted_Corpus
69804a9d-b45a-4484-9cc7-e8f2e72a3997
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,611
supabase-export-v2
94434432778f74c6
Note that setting and getting the value is potentially non-atomic -- use :func:`Value` instead to make sure that access is automatically synchronized using a lock. Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` attributes which allow one to use it to store and retrieve strings -- see documentat...
trusted_official_docs
CPython Docs
Note that setting and getting the value is potentially non-atomic -- use :func:`Value` instead to make sure that access is automatically synchronized using a lock. Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` attributes which allow one to use it to store and retrieve strings -- see documentat...
Note that setting and getting the value is potentially non-atomic -- use :func:`Value` instead to make sure that access is automatically synchronized using a lock. Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` attributes which allow one to use it to store and retrieve strings -- see documentat...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6988ed55-558d-4cce-b047-3fd47bfdcde2
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,929
supabase-export-v2
0720705aeba3de02
Suitable authentication keys can also be generated by using :func:`os.urandom`. This authentication protects :class:`Listener` and :func:`Client` connections, which are reachable by address. It is not applied to the anonymous pipes created by :func:`~multiprocessing.Pipe` or used internally by :class:`~multiprocessing....
trusted_official_docs
CPython Docs
Suitable authentication keys can also be generated by using :func:`os.urandom`. This authentication protects :class:`Listener` and :func:`Client` connections, which are reachable by address. It is not applied to the anonymous pipes created by :func:`~multiprocessing.Pipe` or used internally by :class:`~multiprocessing....
Suitable authentication keys can also be generated by using :func:`os.urandom`. This authentication protects :class:`Listener` and :func:`Client` connections, which are reachable by address. It is not applied to the anonymous pipes created by :func:`~multiprocessing.Pipe` or used internally by :class:`~multiprocessing....
python, official-docs, cpython, P0
Local_Trusted_Corpus
6aa4f3f7-99ba-4947-b2fe-ac97ab7b993a
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,616
supabase-export-v2
bdd5e91b97f1e0dd
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. Note that *lock* and *ctx* are keyword-only parameters.
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. Note that *lock* and *ctx* are keyword-only parameters.
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. Note that *lock* and *ctx* are keyword-only parameters.
python, official-docs, cpython, P0
Local_Trusted_Corpus
6c089251-309f-43fe-a1e9-4f836df51037
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,302
supabase-export-v2
c6807c57d4439cf1
When :mod:`!multiprocessing` is initialized the main process is assigned a random string using :func:`os.urandom`. When a :class:`Process` object is created, it will inherit the authentication key of its parent process, although this may be changed by setting :attr:`authkey` to another byte string.
trusted_official_docs
CPython Docs
When :mod:`!multiprocessing` is initialized the main process is assigned a random string using :func:`os.urandom`. When a :class:`Process` object is created, it will inherit the authentication key of its parent process, although this may be changed by setting :attr:`authkey` to another byte string.
When :mod:`!multiprocessing` is initialized the main process is assigned a random string using :func:`os.urandom`. When a :class:`Process` object is created, it will inherit the authentication key of its parent process, although this may be changed by setting :attr:`authkey` to another byte string.
python, official-docs, cpython, P0
Local_Trusted_Corpus
6c205fac-59d7-4a0a-b44d-99becb83f6f6
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,675
supabase-export-v2
1b87ccf1422d4bb8
a subclass of :class:`BaseProxy` which is used to create proxies for shared objects with this *typeid*. If ``None`` then a proxy class is created automatically. *exposed* is used to specify a sequence of method names which proxies for this typeid should be allowed to access using :meth:`BaseProxy._callmethod`. (If *e...
trusted_official_docs
CPython Docs
a subclass of :class:`BaseProxy` which is used to create proxies for shared objects with this *typeid*. If ``None`` then a proxy class is created automatically. *exposed* is used to specify a sequence of method names which proxies for this typeid should be allowed to access using :meth:`BaseProxy._callmethod`. (If *e...
a subclass of :class:`BaseProxy` which is used to create proxies for shared objects with this *typeid*. If ``None`` then a proxy class is created automatically. *exposed* is used to specify a sequence of method names which proxies for this typeid should be allowed to access using :meth:`BaseProxy._callmethod`. (If *e...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6c6ee4b4-9850-4795-86fc-3078a505add1
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,940
supabase-export-v2
68019ff2ba5b521d
[INFO/SyncManager-...] created temp directory /.../pymp-... [INFO/SyncManager-...] manager serving at '/.../listener-...' >>> del m [INFO/MainProcess] sending shutdown message to manager [INFO/SyncManager-...] manager exiting with exitcode 0 For a full table of logging levels, see the :mod:`logging` module.
trusted_official_docs
CPython Docs
[INFO/SyncManager-...] created temp directory /.../pymp-... [INFO/SyncManager-...] manager serving at '/.../listener-...' >>> del m [INFO/MainProcess] sending shutdown message to manager [INFO/SyncManager-...] manager exiting with exitcode 0 For a full table of logging levels, see the :mod:`logging` module.
[INFO/SyncManager-...] created temp directory /.../pymp-... [INFO/SyncManager-...] manager serving at '/.../listener-...' >>> del m [INFO/MainProcess] sending shutdown message to manager [INFO/SyncManager-...] manager exiting with exitcode 0 For a full table of logging levels, see the :mod:`logging` module.
python, official-docs, cpython, P0
Local_Trusted_Corpus
6cb291ba-755e-44cc-8da8-ec4dcc1c277a
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,749
supabase-export-v2
dd6277f3081ef03f
Notice that applying :func:`str` to a proxy will return the representation of the referent, whereas applying :func:`repr` will return the representation of the proxy. An important feature of proxy objects is that they are picklable so they can be passed between processes. As such, a referent can contain :ref:`multiproc...
trusted_official_docs
CPython Docs
Notice that applying :func:`str` to a proxy will return the representation of the referent, whereas applying :func:`repr` will return the representation of the proxy. An important feature of proxy objects is that they are picklable so they can be passed between processes. As such, a referent can contain :ref:`multiproc...
Notice that applying :func:`str` to a proxy will return the representation of the referent, whereas applying :func:`repr` will return the representation of the proxy. An important feature of proxy objects is that they are picklable so they can be passed between processes. As such, a referent can contain :ref:`multiproc...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6ea9de7a-20fc-438e-9ab0-89c819415b1a
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,172
supabase-export-v2
4f9e37d86878a480
On POSIX platforms the default start method was changed from *fork* to *forkserver* to retain the performance but avoid common multithreaded process incompatibilities. See :gh:`84559`. On POSIX using the *spawn* or *forkserver* start methods will also start a *resource tracker* process which tracks the unlinked named s...
trusted_official_docs
CPython Docs
On POSIX platforms the default start method was changed from *fork* to *forkserver* to retain the performance but avoid common multithreaded process incompatibilities. See :gh:`84559`. On POSIX using the *spawn* or *forkserver* start methods will also start a *resource tracker* process which tracks the unlinked named s...
On POSIX platforms the default start method was changed from *fork* to *forkserver* to retain the performance but avoid common multithreaded process incompatibilities. See :gh:`84559`. On POSIX using the *spawn* or *forkserver* start methods will also start a *resource tracker* process which tracks the unlinked named s...
python, official-docs, cpython, P0
Local_Trusted_Corpus
6f2dbf86-15ff-4c4d-8e16-96b6027e00bb
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,976
supabase-export-v2
e0839da82992934d
fed by the "feeder" thread to the underlying pipe. (The child process can call the :meth:`Queue.cancel_join_thread <multiprocessing.Queue.cancel_join_thread>` method of the queue to avoid this behaviour.) This means that whenever you use a queue you need to make sure that all items which have been put on the queue wil...
trusted_official_docs
CPython Docs
fed by the "feeder" thread to the underlying pipe. (The child process can call the :meth:`Queue.cancel_join_thread <multiprocessing.Queue.cancel_join_thread>` method of the queue to avoid this behaviour.) This means that whenever you use a queue you need to make sure that all items which have been put on the queue wil...
fed by the "feeder" thread to the underlying pipe. (The child process can call the :meth:`Queue.cancel_join_thread <multiprocessing.Queue.cancel_join_thread>` method of the queue to avoid this behaviour.) This means that whenever you use a queue you need to make sure that all items which have been put on the queue wil...
python, official-docs, cpython, P0
Local_Trusted_Corpus
70e3e9b9-583c-4921-9dc3-8022a1ef4971
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,504
supabase-export-v2
3ed9a48ce876562b
.. versionchanged:: 3.3 Connection objects themselves can now be transferred between processes using :meth:`Connection.send` and :meth:`Connection.recv`. Connection objects also now support the context management protocol -- see :ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the connection objec...
trusted_official_docs
CPython Docs
.. versionchanged:: 3.3 Connection objects themselves can now be transferred between processes using :meth:`Connection.send` and :meth:`Connection.recv`. Connection objects also now support the context management protocol -- see :ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the connection objec...
.. versionchanged:: 3.3 Connection objects themselves can now be transferred between processes using :meth:`Connection.send` and :meth:`Connection.recv`. Connection objects also now support the context management protocol -- see :ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the connection objec...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7161dd30-3a4c-400d-999b-06b4b402b25f
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,185
supabase-export-v2
900acdaf08480e61
.. warning:: The ``'spawn'`` and ``'forkserver'`` start methods generally cannot be used with "frozen" executables (i.e., binaries produced by packages like **PyInstaller** and **cx_Freeze**) on POSIX systems. The ``'fork'`` start method may work if code does not use threads.
trusted_official_docs
CPython Docs
.. warning:: The ``'spawn'`` and ``'forkserver'`` start methods generally cannot be used with "frozen" executables (i.e., binaries produced by packages like **PyInstaller** and **cx_Freeze**) on POSIX systems. The ``'fork'`` start method may work if code does not use threads.
.. warning:: The ``'spawn'`` and ``'forkserver'`` start methods generally cannot be used with "frozen" executables (i.e., binaries produced by packages like **PyInstaller** and **cx_Freeze**) on POSIX systems. The ``'fork'`` start method may work if code does not use threads.
python, official-docs, cpython, P0
Local_Trusted_Corpus
728dd07d-c2be-492a-a867-b9c5721f9a02
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,739
supabase-export-v2
42738bf7d8c46329
Another client can also use it:: >>> from multiprocessing.managers import BaseManager >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue') >>> m = QueueManager(address=('foo.bar.org', 50000), authkey=b'abracadabra') >>> m.connect() >>> queue = m.get_queue() >>> queue.get() 'hello'
trusted_official_docs
CPython Docs
Another client can also use it:: >>> from multiprocessing.managers import BaseManager >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue') >>> m = QueueManager(address=('foo.bar.org', 50000), authkey=b'abracadabra') >>> m.connect() >>> queue = m.get_queue() >>> queue.get() 'hello'
Another client can also use it:: >>> from multiprocessing.managers import BaseManager >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue') >>> m = QueueManager(address=('foo.bar.org', 50000), authkey=b'abracadabra') >>> m.connect() >>> queue = m.get_queue() >>> queue.get() 'hello'
python, official-docs, cpython, P0
Local_Trusted_Corpus
72a3b6ac-af8a-4985-8a4a-a65d79925eef
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,931
supabase-export-v2
e5a540b93ea918cb
Logging ^^^^^^^ Some support for logging is available. Note, however, that the :mod:`logging` package does not use process shared locks so it is possible (depending on the handler type) for messages from different processes to get mixed up.
trusted_official_docs
CPython Docs
Logging ^^^^^^^ Some support for logging is available. Note, however, that the :mod:`logging` package does not use process shared locks so it is possible (depending on the handler type) for messages from different processes to get mixed up.
Logging ^^^^^^^ Some support for logging is available. Note, however, that the :mod:`logging` package does not use process shared locks so it is possible (depending on the handler type) for messages from different processes to get mixed up.
python, official-docs, cpython, P0
Local_Trusted_Corpus
74058b5a-bff7-4faf-9cc1-cabd9211c78a
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
7,006
supabase-export-v2
4392557bd86959b8
More picklability Ensure that all arguments to :class:`~multiprocessing.Process` are picklable. Also, if you subclass ``Process.__init__``, you must make sure that instances will be picklable when the :meth:`Process.start <multiprocessing.Process.start>` method is called.
trusted_official_docs
CPython Docs
More picklability Ensure that all arguments to :class:`~multiprocessing.Process` are picklable. Also, if you subclass ``Process.__init__``, you must make sure that instances will be picklable when the :meth:`Process.start <multiprocessing.Process.start>` method is called.
More picklability Ensure that all arguments to :class:`~multiprocessing.Process` are picklable. Also, if you subclass ``Process.__init__``, you must make sure that instances will be picklable when the :meth:`Process.start <multiprocessing.Process.start>` method is called.
python, official-docs, cpython, P0
Local_Trusted_Corpus
7903b1b5-936e-4f8a-b5bd-842c990afd28
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,311
supabase-export-v2
0b17142b0e195b95
terminates the child process by raising :exc:`KeyboardInterrupt`. This behavior can be altered by setting the respective signal handler in the child process :func:`signal.signal` for :py:const:`~signal.SIGINT`. Note: if the child process catches and discards :exc:`KeyboardInterrupt`, the process will not be terminated...
trusted_official_docs
CPython Docs
terminates the child process by raising :exc:`KeyboardInterrupt`. This behavior can be altered by setting the respective signal handler in the child process :func:`signal.signal` for :py:const:`~signal.SIGINT`. Note: if the child process catches and discards :exc:`KeyboardInterrupt`, the process will not be terminated...
terminates the child process by raising :exc:`KeyboardInterrupt`. This behavior can be altered by setting the respective signal handler in the child process :func:`signal.signal` for :py:const:`~signal.SIGINT`. Note: if the child process catches and discards :exc:`KeyboardInterrupt`, the process will not be terminated...
python, official-docs, cpython, P0
Local_Trusted_Corpus
79a6d5eb-c651-4347-9a9b-6d7dacd31d80
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,870
supabase-export-v2
731b4ea03ab23397
Attempt to set up a connection to the listener which is using address *address*, returning a :class:`~Connection`. The type of the connection is determined by *family* argument, but this can generally be omitted since it can usually be inferred from the format of *address*. (See :ref:`multiprocessing-address-formats`...
trusted_official_docs
CPython Docs
Attempt to set up a connection to the listener which is using address *address*, returning a :class:`~Connection`. The type of the connection is determined by *family* argument, but this can generally be omitted since it can usually be inferred from the format of *address*. (See :ref:`multiprocessing-address-formats`...
Attempt to set up a connection to the listener which is using address *address*, returning a :class:`~Connection`. The type of the connection is determined by *family* argument, but this can generally be omitted since it can usually be inferred from the format of *address*. (See :ref:`multiprocessing-address-formats`...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7a5742d5-1b58-4145-b97d-c513fb7bec4c
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,722
supabase-export-v2
9c63858b2f04d42b
A namespace object has no public methods, but does have writable attributes. Its representation shows the values of its attributes. However, when using a proxy for a namespace object, an attribute beginning with ``'_'`` will be an attribute of the proxy and not an attribute of the referent:
trusted_official_docs
CPython Docs
A namespace object has no public methods, but does have writable attributes. Its representation shows the values of its attributes. However, when using a proxy for a namespace object, an attribute beginning with ``'_'`` will be an attribute of the proxy and not an attribute of the referent:
A namespace object has no public methods, but does have writable attributes. Its representation shows the values of its attributes. However, when using a proxy for a namespace object, an attribute beginning with ``'_'`` will be an attribute of the proxy and not an attribute of the referent:
python, official-docs, cpython, P0
Local_Trusted_Corpus
7aee30c3-c668-42cc-9987-a4ec540fab0d
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,375
supabase-export-v2
3e0ffcb810aee058
``False``), put an item on the queue if a free slot is immediately available, else raise the :exc:`queue.Full` exception (*timeout* is ignored in that case). .. versionchanged:: 3.8 If the queue is closed, :exc:`ValueError` is raised instead of :exc:`AssertionError`.
trusted_official_docs
CPython Docs
``False``), put an item on the queue if a free slot is immediately available, else raise the :exc:`queue.Full` exception (*timeout* is ignored in that case). .. versionchanged:: 3.8 If the queue is closed, :exc:`ValueError` is raised instead of :exc:`AssertionError`.
``False``), put an item on the queue if a free slot is immediately available, else raise the :exc:`queue.Full` exception (*timeout* is ignored in that case). .. versionchanged:: 3.8 If the queue is closed, :exc:`ValueError` is raised instead of :exc:`AssertionError`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
7b62d0e4-60b6-41a7-9d3d-67ebe30e5b82
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,953
supabase-export-v2
5ee56881fafc8505
backed by threads, and it has its own type for representing the status of asynchronous jobs, :class:`AsyncResult`, that is not understood by any other libraries. Users should generally prefer to use :class:`concurrent.futures.ThreadPoolExecutor`, which has a simpler interface that was designed around threads from the...
trusted_official_docs
CPython Docs
backed by threads, and it has its own type for representing the status of asynchronous jobs, :class:`AsyncResult`, that is not understood by any other libraries. Users should generally prefer to use :class:`concurrent.futures.ThreadPoolExecutor`, which has a simpler interface that was designed around threads from the...
backed by threads, and it has its own type for representing the status of asynchronous jobs, :class:`AsyncResult`, that is not understood by any other libraries. Users should generally prefer to use :class:`concurrent.futures.ThreadPoolExecutor`, which has a simpler interface that was designed around threads from the...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7c66b3da-c619-4c96-8e6e-96a368f03aab
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,638
supabase-export-v2
4cad8b9838afcc10
n = Value('i', 7) x = Value(c_double, 1.0/3.0, lock=False) s = Array('c', b'hello world', lock=lock) A = Array(Point, [(1.875,-6.25), (-5.75,2.0), (2.375,9.5)], lock=lock) p = Process(target=modify, args=(n, x, s, A)) p.start() p.join()
trusted_official_docs
CPython Docs
n = Value('i', 7) x = Value(c_double, 1.0/3.0, lock=False) s = Array('c', b'hello world', lock=lock) A = Array(Point, [(1.875,-6.25), (-5.75,2.0), (2.375,9.5)], lock=lock) p = Process(target=modify, args=(n, x, s, A)) p.start() p.join()
n = Value('i', 7) x = Value(c_double, 1.0/3.0, lock=False) s = Array('c', b'hello world', lock=lock) A = Array(Point, [(1.875,-6.25), (-5.75,2.0), (2.375,9.5)], lock=lock) p = Process(target=modify, args=(n, x, s, A)) p.start() p.join()
python, official-docs, cpython, P0
Local_Trusted_Corpus
7c929e3b-360f-41a9-be2a-76a0f1d4bf11
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,428
supabase-export-v2
9414d158337c882e
.. versionchanged:: 3.13 The return value can also be overridden using the :option:`-X cpu_count <-X>` flag or :envvar:`PYTHON_CPU_COUNT` as this is merely a wrapper around the :mod:`os` cpu count APIs.
trusted_official_docs
CPython Docs
.. versionchanged:: 3.13 The return value can also be overridden using the :option:`-X cpu_count <-X>` flag or :envvar:`PYTHON_CPU_COUNT` as this is merely a wrapper around the :mod:`os` cpu count APIs.
.. versionchanged:: 3.13 The return value can also be overridden using the :option:`-X cpu_count <-X>` flag or :envvar:`PYTHON_CPU_COUNT` as this is merely a wrapper around the :mod:`os` cpu count APIs.
python, official-docs, cpython, P0
Local_Trusted_Corpus
7ca41884-ed27-4569-9acf-74aa28038ab2
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,822
supabase-export-v2
c06731365a84e84c
A lazier version of :meth:`.map`. The *chunksize* argument is the same as the one used by the :meth:`.map` method. For very long iterables using a large value for *chunksize* can make the job complete **much** faster than using the default value of ``1``.
trusted_official_docs
CPython Docs
A lazier version of :meth:`.map`. The *chunksize* argument is the same as the one used by the :meth:`.map` method. For very long iterables using a large value for *chunksize* can make the job complete **much** faster than using the default value of ``1``.
A lazier version of :meth:`.map`. The *chunksize* argument is the same as the one used by the :meth:`.map` method. For very long iterables using a large value for *chunksize* can make the job complete **much** faster than using the default value of ``1``.
python, official-docs, cpython, P0
Local_Trusted_Corpus
7d067ba7-8888-46b0-b64b-27d1cad640e8
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,151
supabase-export-v2
2f1ec8f721dd4d5a
For an explanation of why the ``if __name__ == '__main__'`` part is necessary, see :ref:`multiprocessing-programming`. The arguments to :class:`Process` usually need to be unpickleable from within the child process. If you tried typing the above example directly into a REPL it could lead to an :exc:`AttributeError` in ...
trusted_official_docs
CPython Docs
For an explanation of why the ``if __name__ == '__main__'`` part is necessary, see :ref:`multiprocessing-programming`. The arguments to :class:`Process` usually need to be unpickleable from within the child process. If you tried typing the above example directly into a REPL it could lead to an :exc:`AttributeError` in ...
For an explanation of why the ``if __name__ == '__main__'`` part is necessary, see :ref:`multiprocessing-programming`. The arguments to :class:`Process` usually need to be unpickleable from within the child process. If you tried typing the above example directly into a REPL it could lead to an :exc:`AttributeError` in ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7d5776ec-49b5-4d0a-8fea-f1db0f5ade1b
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,437
supabase-export-v2
3d21641f2004df28
Add support for when a program which uses :mod:`!multiprocessing` has been frozen to produce an executable. (Has been tested with **py2exe**, **PyInstaller** and **cx_Freeze**.) One needs to call this function straight after the ``if __name__ == '__main__'`` line of the main module. For example::
trusted_official_docs
CPython Docs
Add support for when a program which uses :mod:`!multiprocessing` has been frozen to produce an executable. (Has been tested with **py2exe**, **PyInstaller** and **cx_Freeze**.) One needs to call this function straight after the ``if __name__ == '__main__'`` line of the main module. For example::
Add support for when a program which uses :mod:`!multiprocessing` has been frozen to produce an executable. (Has been tested with **py2exe**, **PyInstaller** and **cx_Freeze**.) One needs to call this function straight after the ``if __name__ == '__main__'`` line of the main module. For example::
python, official-docs, cpython, P0
Local_Trusted_Corpus
7d8b5d0f-3bdc-4ec7-a4df-f0b95be98bf8
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,796
supabase-export-v2
38787991435f034c
this function will have the side effect of setting the current global start method if it has not been set already. See the :func:`get_context` function. Note that the methods of the pool object should only be called by the process which created the pool.
trusted_official_docs
CPython Docs
this function will have the side effect of setting the current global start method if it has not been set already. See the :func:`get_context` function. Note that the methods of the pool object should only be called by the process which created the pool.
this function will have the side effect of setting the current global start method if it has not been set already. See the :func:`get_context` function. Note that the methods of the pool object should only be called by the process which created the pool.
python, official-docs, cpython, P0
Local_Trusted_Corpus
7da20bf4-1adb-4f15-b5da-2b094f408d37
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,791
supabase-export-v2
6e88aace6563c1af
.. class:: Pool([processes[, initializer[, initargs[, maxtasksperchild [, context]]]]]) A process pool object which controls 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.
trusted_official_docs
CPython Docs
.. class:: Pool([processes[, initializer[, initargs[, maxtasksperchild [, context]]]]]) A process pool object which controls 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.
.. class:: Pool([processes[, initializer[, initargs[, maxtasksperchild [, context]]]]]) A process pool object which controls 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.
python, official-docs, cpython, P0
Local_Trusted_Corpus
7da7f96e-8794-4c15-aa1f-a8e804f3b2f3
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,393
supabase-export-v2
1850c75eb2ba3a2b
Prevent :meth:`join_thread` from blocking. In particular, this prevents the background thread from being joined automatically when the process exits -- see :meth:`join_thread`. A better name for this method might be ``allow_exit_without_flush()``. It is likely to cause enqueued data to be lost, and you almost certain...
trusted_official_docs
CPython Docs
Prevent :meth:`join_thread` from blocking. In particular, this prevents the background thread from being joined automatically when the process exits -- see :meth:`join_thread`. A better name for this method might be ``allow_exit_without_flush()``. It is likely to cause enqueued data to be lost, and you almost certain...
Prevent :meth:`join_thread` from blocking. In particular, this prevents the background thread from being joined automatically when the process exits -- see :meth:`join_thread`. A better name for this method might be ``allow_exit_without_flush()``. It is likely to cause enqueued data to be lost, and you almost certain...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7e0818cc-5b1d-48a2-94de-e2be6d038585
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,344
supabase-export-v2
a9e16e3d53a1d58b
.. note:: :mod:`!multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue.Full` exceptions to signal a timeout. They are not available in the :mod:`!multiprocessing` namespace so you need to import them from :mod:`queue`.
trusted_official_docs
CPython Docs
.. note:: :mod:`!multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue.Full` exceptions to signal a timeout. They are not available in the :mod:`!multiprocessing` namespace so you need to import them from :mod:`queue`.
.. note:: :mod:`!multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue.Full` exceptions to signal a timeout. They are not available in the :mod:`!multiprocessing` namespace so you need to import them from :mod:`queue`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
7efa59f1-4819-4347-9c88-d3c26f9ae75d
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,685
supabase-export-v2
57fafb95aa921480
A subclass of :class:`BaseManager` which can be used for the synchronization of processes. Objects of this type are returned by :func:`multiprocessing.Manager`. Its methods create and return :ref:`multiprocessing-proxy_objects` for a number of commonly used data types to be synchronized across processes. This notably ...
trusted_official_docs
CPython Docs
A subclass of :class:`BaseManager` which can be used for the synchronization of processes. Objects of this type are returned by :func:`multiprocessing.Manager`. Its methods create and return :ref:`multiprocessing-proxy_objects` for a number of commonly used data types to be synchronized across processes. This notably ...
A subclass of :class:`BaseManager` which can be used for the synchronization of processes. Objects of this type are returned by :func:`multiprocessing.Manager`. Its methods create and return :ref:`multiprocessing-proxy_objects` for a number of commonly used data types to be synchronized across processes. This notably ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
7f360be2-dd5d-4bc3-9f8e-da036ec64d13
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,367
supabase-export-v2
7334c79f4014b397
Return the approximate size of the queue. Because of multithreading/multiprocessing semantics, this number is not reliable. Note that this may raise :exc:`NotImplementedError` on platforms like macOS where ``sem_getvalue()`` is not implemented.
trusted_official_docs
CPython Docs
Return the approximate size of the queue. Because of multithreading/multiprocessing semantics, this number is not reliable. Note that this may raise :exc:`NotImplementedError` on platforms like macOS where ``sem_getvalue()`` is not implemented.
Return the approximate size of the queue. Because of multithreading/multiprocessing semantics, this number is not reliable. Note that this may raise :exc:`NotImplementedError` on platforms like macOS where ``sem_getvalue()`` is not implemented.
python, official-docs, cpython, P0
Local_Trusted_Corpus
80398a5d-b934-4440-a3c1-e4d4f009f4f9
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,975
supabase-export-v2
20c1eb65efdec320
Joining processes that use queues Bear in mind that a process that has put items in a queue will wait before terminating until all the buffered items are fed by the "feeder" thread to the underlying pipe. (The child process can call the :meth:`Queue.cancel_join_thread <multiprocessing.Queue.cancel_join_thread>` met...
trusted_official_docs
CPython Docs
Joining processes that use queues Bear in mind that a process that has put items in a queue will wait before terminating until all the buffered items are fed by the "feeder" thread to the underlying pipe. (The child process can call the :meth:`Queue.cancel_join_thread <multiprocessing.Queue.cancel_join_thread>` met...
Joining processes that use queues Bear in mind that a process that has put items in a queue will wait before terminating until all the buffered items are fed by the "feeder" thread to the underlying pipe. (The child process can call the :meth:`Queue.cancel_join_thread <multiprocessing.Queue.cancel_join_thread>` met...
python, official-docs, cpython, P0
Local_Trusted_Corpus
80a28724-2bc7-4105-96f3-84a4786bafcc
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,555
supabase-export-v2
36bdbbd09019c14e
Note that :class:`RLock` is actually a factory function which returns an instance of ``multiprocessing.synchronize.RLock`` 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:`RLock` is actually a factory function which returns an instance of ``multiprocessing.synchronize.RLock`` 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:`RLock` is actually a factory function which returns an instance of ``multiprocessing.synchronize.RLock`` 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
80ab567d-b3c8-41df-ae25-3d6b333d6bd1
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,580
supabase-export-v2
6306f840fa465674
.. note:: Some of this package's functionality requires a functioning shared semaphore implementation on the host operating system. Without one, the :mod:`multiprocessing.synchronize` module will be disabled, and attempts to import it will result in an :exc:`ImportError`. See :issue:`3770` for additional informatio...
trusted_official_docs
CPython Docs
.. note:: Some of this package's functionality requires a functioning shared semaphore implementation on the host operating system. Without one, the :mod:`multiprocessing.synchronize` module will be disabled, and attempts to import it will result in an :exc:`ImportError`. See :issue:`3770` for additional informatio...
.. note:: Some of this package's functionality requires a functioning shared semaphore implementation on the host operating system. Without one, the :mod:`multiprocessing.synchronize` module will be disabled, and attempts to import it will result in an :exc:`ImportError`. See :issue:`3770` for additional informatio...
python, official-docs, cpython, P0
Local_Trusted_Corpus
80cc60de-0592-4eba-bace-12e47362f34b
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,952
supabase-export-v2
5b699d84a7812934
.. note:: A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is designed around a pool of processes and predates the introduction of the :class:`concurrent.futures` module. As such, it inherits some operations that don't make sense for a pool backed by threads, and it has its own type for repre...
trusted_official_docs
CPython Docs
.. note:: A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is designed around a pool of processes and predates the introduction of the :class:`concurrent.futures` module. As such, it inherits some operations that don't make sense for a pool backed by threads, and it has its own type for repre...
.. note:: A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is designed around a pool of processes and predates the introduction of the :class:`concurrent.futures` module. As such, it inherits some operations that don't make sense for a pool backed by threads, and it has its own type for repre...
python, official-docs, cpython, P0
Local_Trusted_Corpus
81f605a6-58e2-425e-981a-9c8176e8577a
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,631
supabase-export-v2
f29089deb1691902
compares the syntax for creating shared ctypes objects from shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is some subclass of :class:`ctypes.Structure`.) ==================== ========================== =========================== ctypes sharedctypes using type sharedctypes using typecode =====...
trusted_official_docs
CPython Docs
compares the syntax for creating shared ctypes objects from shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is some subclass of :class:`ctypes.Structure`.) ==================== ========================== =========================== ctypes sharedctypes using type sharedctypes using typecode =====...
compares the syntax for creating shared ctypes objects from shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is some subclass of :class:`ctypes.Structure`.) ==================== ========================== =========================== ctypes sharedctypes using type sharedctypes using typecode =====...
python, official-docs, cpython, P0
Local_Trusted_Corpus
82936e2b-6652-48b5-a27f-1b1726b2109b
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,463
supabase-export-v2
18fa2174ff3b2cfe
.. function:: set_forkserver_preload(module_names, *, on_error='ignore') Set a list of module names for the forkserver main process to attempt to import so that their already imported state is inherited by forked processes. This can be used as a performance enhancement to avoid repeated work in every process.
trusted_official_docs
CPython Docs
.. function:: set_forkserver_preload(module_names, *, on_error='ignore') Set a list of module names for the forkserver main process to attempt to import so that their already imported state is inherited by forked processes. This can be used as a performance enhancement to avoid repeated work in every process.
.. function:: set_forkserver_preload(module_names, *, on_error='ignore') Set a list of module names for the forkserver main process to attempt to import so that their already imported state is inherited by forked processes. This can be used as a performance enhancement to avoid repeated work in every process.
python, official-docs, cpython, P0
Local_Trusted_Corpus
8297ce57-fb0a-44e9-a9ca-4492c731cb95
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,267
supabase-export-v2
958264bf6e8dc170
line ..., in spawn_main File ".../multiprocessing/spawn.py", line ..., in _main AttributeError: module '__main__' has no attribute 'knigit' >>> process <SpawnProcess name='SpawnProcess-1' pid=379473 parent=378707 stopped exitcode=1> See :ref:`multiprocessing-programming-spawn`. While this restriction is not true if us...
trusted_official_docs
CPython Docs
line ..., in spawn_main File ".../multiprocessing/spawn.py", line ..., in _main AttributeError: module '__main__' has no attribute 'knigit' >>> process <SpawnProcess name='SpawnProcess-1' pid=379473 parent=378707 stopped exitcode=1> See :ref:`multiprocessing-programming-spawn`. While this restriction is not true if us...
line ..., in spawn_main File ".../multiprocessing/spawn.py", line ..., in _main AttributeError: module '__main__' has no attribute 'knigit' >>> process <SpawnProcess name='SpawnProcess-1' pid=379473 parent=378707 stopped exitcode=1> See :ref:`multiprocessing-programming-spawn`. While this restriction is not true if us...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8425ae4e-4e11-44ee-b393-bb89dd8a8724
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,939
supabase-export-v2
4dd526c9b84ad29f
Below is an example session with logging turned on:: >>> import multiprocessing, logging >>> logger = multiprocessing.log_to_stderr() >>> logger.setLevel(logging.INFO) >>> logger.warning('doomed') [WARNING/MainProcess] doomed >>> m = multiprocessing.Manager() [INFO/SyncManager-...] child process calling self.run(...
trusted_official_docs
CPython Docs
Below is an example session with logging turned on:: >>> import multiprocessing, logging >>> logger = multiprocessing.log_to_stderr() >>> logger.setLevel(logging.INFO) >>> logger.warning('doomed') [WARNING/MainProcess] doomed >>> m = multiprocessing.Manager() [INFO/SyncManager-...] child process calling self.run(...
Below is an example session with logging turned on:: >>> import multiprocessing, logging >>> logger = multiprocessing.log_to_stderr() >>> logger.setLevel(logging.INFO) >>> logger.warning('doomed') [WARNING/MainProcess] doomed >>> m = multiprocessing.Manager() [INFO/SyncManager-...] child process calling self.run(...
python, official-docs, cpython, P0
Local_Trusted_Corpus
84e8a839-baa6-4c63-bb02-2cd8fd11105e
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,935
supabase-export-v2
0e4327af9002b9f2
first created the logger has level :const:`logging.NOTSET` and no default handler. Messages sent to this logger will not by default propagate to the root logger. Note that on Windows child processes will only inherit the level of the parent process's logger -- any other customization of the logger will not be inherit...
trusted_official_docs
CPython Docs
first created the logger has level :const:`logging.NOTSET` and no default handler. Messages sent to this logger will not by default propagate to the root logger. Note that on Windows child processes will only inherit the level of the parent process's logger -- any other customization of the logger will not be inherit...
first created the logger has level :const:`logging.NOTSET` and no default handler. Messages sent to this logger will not by default propagate to the root logger. Note that on Windows child processes will only inherit the level of the parent process's logger -- any other customization of the logger will not be inherit...
python, official-docs, cpython, P0
Local_Trusted_Corpus
855115c4-a893-4a11-95b7-db92c73de740
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,946
supabase-export-v2
3e43bcfaadd14a70
: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. .. class:: ThreadPool([processes[, initializer[, initargs]]])
trusted_official_docs
CPython Docs
: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. .. class:: ThreadPool([processes[, initializer[, initargs]]])
: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. .. class:: ThreadPool([processes[, initializer[, initargs]]])
python, official-docs, cpython, P0
Local_Trusted_Corpus
868ecf12-e9c5-44c9-99f5-be2e97463120
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,324
supabase-export-v2
8a8eec0085dec4fc
Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:`terminate` and :attr:`exitcode` methods should only be called by the process that created the process object. Example usage of some of the methods of :class:`Process`:
trusted_official_docs
CPython Docs
Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:`terminate` and :attr:`exitcode` methods should only be called by the process that created the process object. Example usage of some of the methods of :class:`Process`:
Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:`terminate` and :attr:`exitcode` methods should only be called by the process that created the process object. Example usage of some of the methods of :class:`Process`:
python, official-docs, cpython, P0
Local_Trusted_Corpus
871d2481-9f26-4669-aa56-c790712d92e9
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,169
supabase-export-v2
40d3bd779dee8de5
.. 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 as macOS system libraries may start threads. 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 as macOS system libraries may start threads. 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 as macOS system libraries may start threads. See :issue:`33725`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
871fe32b-8d06-43e0-8c1d-da569934f69d
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,630
supabase-export-v2
8bc75d0f88638229
.. versionchanged:: 3.5 Synchronized objects support the :term:`context manager` protocol. The table below compares the syntax for creating shared ctypes objects from shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is some subclass of :class:`ctypes.Structure`.)
trusted_official_docs
CPython Docs
.. versionchanged:: 3.5 Synchronized objects support the :term:`context manager` protocol. The table below compares the syntax for creating shared ctypes objects from shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is some subclass of :class:`ctypes.Structure`.)
.. versionchanged:: 3.5 Synchronized objects support the :term:`context manager` protocol. The table below compares the syntax for creating shared ctypes objects from shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is some subclass of :class:`ctypes.Structure`.)
python, official-docs, cpython, P0
Local_Trusted_Corpus
87290120-399c-493d-87ee-72f70534958e
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,826
supabase-export-v2
6051bc040ba702cb
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:: starmap(func, iterable[, chunksize])
trusted_official_docs
CPython Docs
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:: starmap(func, iterable[, chunksize])
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:: starmap(func, iterable[, chunksize])
python, official-docs, cpython, P0
Local_Trusted_Corpus
877dca04-192a-4912-8aed-c79b06df4289
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,559
supabase-export-v2
fd7fed19801ef4d0
Acquire a lock, blocking or non-blocking. When invoked with the *block* argument set to ``True``, block until the lock is in an unlocked state (not owned by any process or thread) unless the lock is already owned by the current process or thread. The current process or thread then takes ownership of the lock (if it ...
trusted_official_docs
CPython Docs
Acquire a lock, blocking or non-blocking. When invoked with the *block* argument set to ``True``, block until the lock is in an unlocked state (not owned by any process or thread) unless the lock is already owned by the current process or thread. The current process or thread then takes ownership of the lock (if it ...
Acquire a lock, blocking or non-blocking. When invoked with the *block* argument set to ``True``, block until the lock is in an unlocked state (not owned by any process or thread) unless the lock is already owned by the current process or thread. The current process or thread then takes ownership of the lock (if it ...
python, official-docs, cpython, P0
Local_Trusted_Corpus
87fa4716-2e9e-4e2e-a65e-695fc07b4c4e
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,279
supabase-export-v2
7df89df1d1cc443e
Note that the method returns ``None`` if its process terminates or if the method times out. Check the process's :attr:`exitcode` to determine if it terminated. A process can be joined many times.
trusted_official_docs
CPython Docs
Note that the method returns ``None`` if its process terminates or if the method times out. Check the process's :attr:`exitcode` to determine if it terminated. A process can be joined many times.
Note that the method returns ``None`` if its process terminates or if the method times out. Check the process's :attr:`exitcode` to determine if it terminated. A process can be joined many times.
python, official-docs, cpython, P0
Local_Trusted_Corpus
881314f6-b2be-4766-b6ad-80e087456a58
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,797
supabase-export-v2
164f1f71594bef78
Note that the methods of the pool object should only be called by the process which created the pool. .. warning:: :class:`multiprocessing.pool` objects have internal resources that need to be properly managed (like any other resource) by using the pool as a context manager or by calling :meth:`close` and :meth:`ter...
trusted_official_docs
CPython Docs
Note that the methods of the pool object should only be called by the process which created the pool. .. warning:: :class:`multiprocessing.pool` objects have internal resources that need to be properly managed (like any other resource) by using the pool as a context manager or by calling :meth:`close` and :meth:`ter...
Note that the methods of the pool object should only be called by the process which created the pool. .. warning:: :class:`multiprocessing.pool` objects have internal resources that need to be properly managed (like any other resource) by using the pool as a context manager or by calling :meth:`close` and :meth:`ter...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8d26d623-ef46-4a60-85a3-21f23a5b5f45
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,753
supabase-export-v2
dfe9e7a07e67fcef
Similarly, dict and list proxies may be nested inside one another:: >>> l_outer = manager.list([ manager.dict() for i in range(2) ]) >>> d_first_inner = l_outer[0] >>> d_first_inner['a'] = 1 >>> d_first_inner['b'] = 2 >>> l_outer[1]['c'] = 3 >>> l_outer[1]['z'] = 26 >>> print(l_outer[0]) {'a': 1, 'b': 2} >>> pr...
trusted_official_docs
CPython Docs
Similarly, dict and list proxies may be nested inside one another:: >>> l_outer = manager.list([ manager.dict() for i in range(2) ]) >>> d_first_inner = l_outer[0] >>> d_first_inner['a'] = 1 >>> d_first_inner['b'] = 2 >>> l_outer[1]['c'] = 3 >>> l_outer[1]['z'] = 26 >>> print(l_outer[0]) {'a': 1, 'b': 2} >>> pr...
Similarly, dict and list proxies may be nested inside one another:: >>> l_outer = manager.list([ manager.dict() for i in range(2) ]) >>> d_first_inner = l_outer[0] >>> d_first_inner['a'] = 1 >>> d_first_inner['b'] = 2 >>> l_outer[1]['c'] = 3 >>> l_outer[1]['z'] = 26 >>> print(l_outer[0]) {'a': 1, 'b': 2} >>> pr...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8d86e403-2536-4e12-8583-452424cd7d05
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,261
supabase-export-v2
0a90ec2477db9804
to *target*. The *args* argument, which defaults to ``()``, can be used to specify a list or tuple of the arguments to pass to *target*. If a subclass overrides the constructor, it must make sure it invokes the base class constructor (``super().__init__()``) before doing anything else to the process.
trusted_official_docs
CPython Docs
to *target*. The *args* argument, which defaults to ``()``, can be used to specify a list or tuple of the arguments to pass to *target*. If a subclass overrides the constructor, it must make sure it invokes the base class constructor (``super().__init__()``) before doing anything else to the process.
to *target*. The *args* argument, which defaults to ``()``, can be used to specify a list or tuple of the arguments to pass to *target*. If a subclass overrides the constructor, it must make sure it invokes the base class constructor (``super().__init__()``) before doing anything else to the process.
python, official-docs, cpython, P0
Local_Trusted_Corpus
8de07bb9-a6cf-4bc3-801e-5355db859e51
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,864
supabase-export-v2
2d48d27ef98d8bd2
Send a randomly generated message to the other end of the connection and wait for a reply. If the reply matches the digest of the message using *authkey* as the key then a welcome message is sent to the other end of the connection. Otherwise :exc:`~multiprocessing.AuthenticationError` is raised.
trusted_official_docs
CPython Docs
Send a randomly generated message to the other end of the connection and wait for a reply. If the reply matches the digest of the message using *authkey* as the key then a welcome message is sent to the other end of the connection. Otherwise :exc:`~multiprocessing.AuthenticationError` is raised.
Send a randomly generated message to the other end of the connection and wait for a reply. If the reply matches the digest of the message using *authkey* as the key then a welcome message is sent to the other end of the connection. Otherwise :exc:`~multiprocessing.AuthenticationError` is raised.
python, official-docs, cpython, P0
Local_Trusted_Corpus
8f591ecd-64e8-4b3b-99d6-64ba2a7a5436
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,465
supabase-export-v2
4161eebab8556c77
For this to work, it must be called before the forkserver process has been launched (before creating a :class:`Pool` or starting a :class:`Process`). The *on_error* parameter controls how :exc:`ImportError` exceptions during module preloading are handled: ``"ignore"`` (default) silently ignores failures, ``"warn"`` c...
trusted_official_docs
CPython Docs
For this to work, it must be called before the forkserver process has been launched (before creating a :class:`Pool` or starting a :class:`Process`). The *on_error* parameter controls how :exc:`ImportError` exceptions during module preloading are handled: ``"ignore"`` (default) silently ignores failures, ``"warn"`` c...
For this to work, it must be called before the forkserver process has been launched (before creating a :class:`Pool` or starting a :class:`Process`). The *on_error* parameter controls how :exc:`ImportError` exceptions during module preloading are handled: ``"ignore"`` (default) silently ignores failures, ``"warn"`` c...
python, official-docs, cpython, P0
Local_Trusted_Corpus
8f8afde5-6ccc-4341-8772-3c99df598f79
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,849
supabase-export-v2
020021cc7cfdab3b
Return whether the call completed without raising an exception. Will raise :exc:`ValueError` if the result is not ready. .. versionchanged:: 3.7 If the result is not ready, :exc:`ValueError` is raised instead of :exc:`AssertionError`.
trusted_official_docs
CPython Docs
Return whether the call completed without raising an exception. Will raise :exc:`ValueError` if the result is not ready. .. versionchanged:: 3.7 If the result is not ready, :exc:`ValueError` is raised instead of :exc:`AssertionError`.
Return whether the call completed without raising an exception. Will raise :exc:`ValueError` if the result is not ready. .. versionchanged:: 3.7 If the result is not ready, :exc:`ValueError` is raised instead of :exc:`AssertionError`.
python, official-docs, cpython, P0
Local_Trusted_Corpus
8fdcf302-279d-4846-a492-7f8891498391
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,649
supabase-export-v2
ff4c784cae46ad20
processes will be shutdown as soon as they are garbage collected or their parent process exits. The manager classes are defined in the :mod:`multiprocessing.managers` module: .. class:: BaseManager(address=None, authkey=None, serializer='pickle', ctx=None, *, shutdown_timeout=1.0)
trusted_official_docs
CPython Docs
processes will be shutdown as soon as they are garbage collected or their parent process exits. The manager classes are defined in the :mod:`multiprocessing.managers` module: .. class:: BaseManager(address=None, authkey=None, serializer='pickle', ctx=None, *, shutdown_timeout=1.0)
processes will be shutdown as soon as they are garbage collected or their parent process exits. The manager classes are defined in the :mod:`multiprocessing.managers` module: .. class:: BaseManager(address=None, authkey=None, serializer='pickle', ctx=None, *, shutdown_timeout=1.0)
python, official-docs, cpython, P0
Local_Trusted_Corpus
907ba2af-50bf-47f5-9672-8ca8d791b483
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,853
supabase-export-v2
bbd196f0f988ae55
def f(x): return x*x if __name__ == '__main__': with Pool(processes=4) as pool: # start 4 worker processes result = pool.apply_async(f, (10,)) # evaluate "f(10)" asynchronously in a single process print(result.get(timeout=1)) # prints "100" unless your computer is *very* slow
trusted_official_docs
CPython Docs
def f(x): return x*x if __name__ == '__main__': with Pool(processes=4) as pool: # start 4 worker processes result = pool.apply_async(f, (10,)) # evaluate "f(10)" asynchronously in a single process print(result.get(timeout=1)) # prints "100" unless your computer is *very* slow
def f(x): return x*x if __name__ == '__main__': with Pool(processes=4) as pool: # start 4 worker processes result = pool.apply_async(f, (10,)) # evaluate "f(10)" asynchronously in a single process print(result.get(timeout=1)) # prints "100" unless your computer is *very* slow
python, official-docs, cpython, P0
Local_Trusted_Corpus
90fdc364-3b25-48c9-bab4-c4507488baff
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,224
supabase-export-v2
a07eb5b3a8e5853a
manager returned by :func:`Manager` will support types :class:`list`, :class:`dict`, :class:`set`, :class:`~managers.Namespace`, :class:`Lock`, :class:`RLock`, :class:`Semaphore`, :class:`BoundedSemaphore`, :class:`Condition`, :class:`Event`, :class:`Barrier`, :class:`Queue`, :class:`Value` and :class:`Array`. For exam...
trusted_official_docs
CPython Docs
manager returned by :func:`Manager` will support types :class:`list`, :class:`dict`, :class:`set`, :class:`~managers.Namespace`, :class:`Lock`, :class:`RLock`, :class:`Semaphore`, :class:`BoundedSemaphore`, :class:`Condition`, :class:`Event`, :class:`Barrier`, :class:`Queue`, :class:`Value` and :class:`Array`. For exam...
manager returned by :func:`Manager` will support types :class:`list`, :class:`dict`, :class:`set`, :class:`~managers.Namespace`, :class:`Lock`, :class:`RLock`, :class:`Semaphore`, :class:`BoundedSemaphore`, :class:`Condition`, :class:`Event`, :class:`Barrier`, :class:`Queue`, :class:`Value` and :class:`Array`. For exam...
python, official-docs, cpython, P0
Local_Trusted_Corpus
922b7e47-c8a1-4c48-bdd2-a54f27a777ad
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,856
supabase-export-v2
05d980374c8302eb
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 result = pool.apply_async(time.sleep, (10,)) print(result.get(timeout=1)) # raises multiprocessing.TimeoutError
trusted_official_docs
CPython Docs
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 result = pool.apply_async(time.sleep, (10,)) print(result.get(timeout=1)) # raises multiprocessing.TimeoutError
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 result = pool.apply_async(time.sleep, (10,)) print(result.get(timeout=1)) # raises multiprocessing.TimeoutError
python, official-docs, cpython, P0
Local_Trusted_Corpus
92ecb860-392f-424f-b7de-d1dc7db738e6
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,674
supabase-export-v2
13f6397606778987
instance will be connected to the server using the :meth:`connect` method, or if the *create_method* argument is ``False`` then this can be left as ``None``. *proxytype* is a subclass of :class:`BaseProxy` which is used to create proxies for shared objects with this *typeid*. If ``None`` then a proxy class is created...
trusted_official_docs
CPython Docs
instance will be connected to the server using the :meth:`connect` method, or if the *create_method* argument is ``False`` then this can be left as ``None``. *proxytype* is a subclass of :class:`BaseProxy` which is used to create proxies for shared objects with this *typeid*. If ``None`` then a proxy class is created...
instance will be connected to the server using the :meth:`connect` method, or if the *create_method* argument is ``False`` then this can be left as ``None``. *proxytype* is a subclass of :class:`BaseProxy` which is used to create proxies for shared objects with this *typeid*. If ``None`` then a proxy class is created...
python, official-docs, cpython, P0
Local_Trusted_Corpus
933dd497-af08-4256-9bf3-305d0deaca47
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,141
supabase-export-v2
0253a4211b22a4ee
The :class:`Process` class ^^^^^^^^^^^^^^^^^^^^^^^^^^ In :mod:`!multiprocessing`, processes are spawned by creating a :class:`Process` object and then calling its :meth:`~Process.start` method. :class:`Process` follows the API of :class:`threading.Thread`. A trivial example of a multiprocess program is ::
trusted_official_docs
CPython Docs
The :class:`Process` class ^^^^^^^^^^^^^^^^^^^^^^^^^^ In :mod:`!multiprocessing`, processes are spawned by creating a :class:`Process` object and then calling its :meth:`~Process.start` method. :class:`Process` follows the API of :class:`threading.Thread`. A trivial example of a multiprocess program is ::
The :class:`Process` class ^^^^^^^^^^^^^^^^^^^^^^^^^^ In :mod:`!multiprocessing`, processes are spawned by creating a :class:`Process` object and then calling its :meth:`~Process.start` method. :class:`Process` follows the API of :class:`threading.Thread`. A trivial example of a multiprocess program is ::
python, official-docs, cpython, P0
Local_Trusted_Corpus
949a6057-0bb2-4b90-9f3d-ce8bef7a8e91
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,893
supabase-export-v2
acfea1529aabbbc4
For both POSIX and Windows, an object can appear in *object_list* if it is * a readable :class:`~multiprocessing.connection.Connection` object; * a connected and readable :class:`socket.socket` object; or * the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:`~multiprocessing.Process` object.
trusted_official_docs
CPython Docs
For both POSIX and Windows, an object can appear in *object_list* if it is * a readable :class:`~multiprocessing.connection.Connection` object; * a connected and readable :class:`socket.socket` object; or * the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:`~multiprocessing.Process` object.
For both POSIX and Windows, an object can appear in *object_list* if it is * a readable :class:`~multiprocessing.connection.Connection` object; * a connected and readable :class:`socket.socket` object; or * the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:`~multiprocessing.Process` object.
python, official-docs, cpython, P0
Local_Trusted_Corpus
94f525d4-c068-441a-8216-648ecf7b82c7
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,966
supabase-export-v2
a5de2866fe213465
Do not use a proxy object from more than one thread unless you protect it with a lock. (There is never a problem with different processes using the *same* proxy.)
trusted_official_docs
CPython Docs
Do not use a proxy object from more than one thread unless you protect it with a lock. (There is never a problem with different processes using the *same* proxy.)
Do not use a proxy object from more than one thread unless you protect it with a lock. (There is never a problem with different processes using the *same* proxy.)
python, official-docs, cpython, P0
Local_Trusted_Corpus
94f6f823-8a0c-4ba5-8e03-4ab821262609
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,561
supabase-export-v2
354e9693ab1eda8d
is in an unlocked state, the current process or thread takes ownership and the recursion level is incremented, resulting in a return value of ``True``. Use and behaviors of the *timeout* argument are the same as in :meth:`Lock.acquire`. Note that some of these behaviors of *timeout* differ from the implemented behavi...
trusted_official_docs
CPython Docs
is in an unlocked state, the current process or thread takes ownership and the recursion level is incremented, resulting in a return value of ``True``. Use and behaviors of the *timeout* argument are the same as in :meth:`Lock.acquire`. Note that some of these behaviors of *timeout* differ from the implemented behavi...
is in an unlocked state, the current process or thread takes ownership and the recursion level is incremented, resulting in a return value of ``True``. Use and behaviors of the *timeout* argument are the same as in :meth:`Lock.acquire`. Note that some of these behaviors of *timeout* differ from the implemented behavi...
python, official-docs, cpython, P0
Local_Trusted_Corpus
951cc2bf-ef01-4a1d-87e1-27a9a025326c
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,969
supabase-export-v2
3a3739c4844ab554
a finished process's :meth:`Process.is_alive <multiprocessing.Process.is_alive>` will join the process. Even so it is probably good practice to explicitly join all the processes that you start. Better to inherit than pickle/unpickle
trusted_official_docs
CPython Docs
a finished process's :meth:`Process.is_alive <multiprocessing.Process.is_alive>` will join the process. Even so it is probably good practice to explicitly join all the processes that you start. Better to inherit than pickle/unpickle
a finished process's :meth:`Process.is_alive <multiprocessing.Process.is_alive>` will join the process. Even so it is probably good practice to explicitly join all the processes that you start. Better to inherit than pickle/unpickle
python, official-docs, cpython, P0
Local_Trusted_Corpus
95f0aa12-baa1-4a5c-a36d-3ad086df77a5
CPython Docs
file://datasets/cpython/Doc/library/multiprocessing.rst
unknown
dabaa007-4d48-4185-8c2f-de72cec02891
6,756
supabase-export-v2
66c7bedfcfc6daba
point, the changes to d are not yet synced, but by # updating the dictionary, the proxy is notified of the change lproxy[0] = d This approach is perhaps less convenient than employing nested :ref:`multiprocessing-proxy_objects` for most use cases but also demonstrates a level of control over the synchronization.
trusted_official_docs
CPython Docs
point, the changes to d are not yet synced, but by # updating the dictionary, the proxy is notified of the change lproxy[0] = d This approach is perhaps less convenient than employing nested :ref:`multiprocessing-proxy_objects` for most use cases but also demonstrates a level of control over the synchronization.
point, the changes to d are not yet synced, but by # updating the dictionary, the proxy is notified of the change lproxy[0] = d This approach is perhaps less convenient than employing nested :ref:`multiprocessing-proxy_objects` for most use cases but also demonstrates a level of control over the synchronization.
python, official-docs, cpython, P0
Local_Trusted_Corpus