Lines Matching +full:initializer +full:- +full:overrides
1 :mod:`multiprocessing` --- Process-based parallelism
5 :synopsis: Process-based parallelism.
9 --------------
11 .. include:: ../includes/wasm-notavail.rst
14 ------------
18 offers both local and remote concurrency, effectively side-stepping the
98 necessary, see :ref:`multiprocessing-programming`.
105 .. _multiprocessing-start-methods:
248 pipe which by default is duplex (two-way). For example::
318 a[i] = -a[i]
334 [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
339 objects will be process and thread-safe.
436 # exiting the 'with'-block has stopped the pool
445 importable by the children. This is covered in :ref:`multiprocessing-programming`
457 Process PoolWorker-1:
458 Process PoolWorker-2:
459 Process PoolWorker-3:
468 interleaved in a semi-random fashion, and then you may have to
473 ---------
496 the keyword-only *daemon* argument sets the process :attr:`daemon` flag
504 If a subclass overrides the constructor, it must make sure it invokes the
562 'Process-N\ :sub:`1`:N\ :sub:`2`:...:N\ :sub:`k`' is constructed, where
563 each N\ :sub:`k` is the N-th child of its parent.
586 terminated (and not joined) if non-daemonic processes have exited.
607 signal *N*, the exit code will be the negative value *-N*.
620 See :ref:`multiprocessing-auth-keys`.
643 Note that descendant processes of the process will *not* be terminated --
688 <Process ... stopped exitcode=-SIGTERM> False
689 >>> p.exitcode == -signal.SIGTERM
723 are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)`
734 Note that one can also create a shared queue by using a manager object -- see
735 :ref:`multiprocessing-managers`.
749 but should not cause any practical difficulties -- if they really
751 :ref:`manager <multiprocessing-managers>`.
759 the objects to be received at the other end out-of-order.
779 consumed. Similarly, if the child process is non-daemonic then the parent
780 process may hang on exit when it tries to join all its non-daemonic children.
783 :ref:`multiprocessing-programming`.
786 :ref:`multiprocessing-examples`.
893 exits -- see :meth:`join_thread`.
1090 Accepts a :term:`path-like object`.
1124 :func:`Pipe <multiprocessing.Pipe>` -- see also
1125 :ref:`multiprocessing-listeners-clients`.
1167 Send byte data from a :term:`bytes-like object` as a complete message.
1198 *buffer* must be a writable :term:`bytes-like object`. If
1200 that position. Offset must be a non-negative integer less than the
1212 Connection objects now support the context management protocol -- see
1237 .. _multiprocessing-recv-pickle-security:
1248 :ref:`multiprocessing-auth-keys`.
1267 object -- see :ref:`multiprocessing-managers`.
1304 A non-recursive lock object: a close analog of :class:`threading.Lock`.
1321 Acquire a lock, blocking or non-blocking.
1332 When invoked with a positive, floating-point value for *timeout*, block
1372 Acquire a lock, blocking or non-blocking.
1428 If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main thread is
1467 by a lock, so it will not necessarily be "process-safe".
1481 Note that *lock* is a keyword-only argument.
1500 "process-safe".
1537 Note that setting and getting an element is potentially non-atomic -- use
1549 Note that setting and getting the value is potentially non-atomic -- use
1554 attributes which allow one to use it to store and retrieve strings -- see
1560 process-safe synchronization wrapper may be returned instead of a raw ctypes
1569 "process-safe".
1571 Note that *lock* is a keyword-only argument.
1576 process-safe synchronization wrapper may be returned instead of a raw ctypes
1584 "process-safe".
1586 Note that *lock* is a keyword-only argument.
1595 Return a process-safe wrapper object for a ctypes object which uses *lock* to
1648 A = Array(Point, [(1.875,-6.25), (-5.75,2.0), (2.375,9.5)], lock=lock)
1672 .. _multiprocessing-managers:
1727 .. method:: start([initializer[, initargs]])
1729 Start a subprocess to start the manager. If *initializer* is not ``None``
1730 then the subprocess will call ``initializer(*initargs)`` when it starts.
1798 :class:`BaseManager` instances also have one read-only property:
1805 Manager objects support the context management protocol -- see
1819 Its methods create and return :ref:`multiprocessing-proxy_objects` for a
2006 .. _multiprocessing-proxy_objects:
2039 :ref:`multiprocessing-proxy_objects`. This permits nesting of these managed
2040 lists, dicts, and other :ref:`multiprocessing-proxy_objects`:
2066 If standard (non-proxy) :class:`list` or :class:`dict` objects are contained
2071 the manager and so to effectively modify such an item, one could re-assign the
2086 :ref:`multiprocessing-proxy_objects` for most use cases but also
2120 a new shared object -- see documentation for the *method_to_typeid*
2123 If an exception is raised by the call, then is re-raised by
2179 .. class:: Pool([processes[, initializer[, initargs[, maxtasksperchild [, context]]]]])
2188 If *initializer* is not ``None`` then each worker process will call
2189 ``initializer(*initargs)`` when it starts.
2257 A parallel equivalent of the :func:`map` built-in function (it supports only
2342 Pool objects now support the context management protocol -- see
2400 .. _multiprocessing-listeners-clients:
2443 *address*. (See :ref:`multiprocessing-address-formats`)
2446 used as the secret key for an HMAC-based authentication challenge. No
2449 See :ref:`multiprocessing-auth-keys`.
2462 end point on Windows. If you require a connectable end-point,
2472 :ref:`multiprocessing-address-formats`. Note that if *family* is
2481 used as the secret key for an HMAC-based authentication challenge. No
2484 See :ref:`multiprocessing-auth-keys`.
2499 Listener objects have the following read-only properties:
2511 Listener objects now support the context management protocol -- see
2624 .. _multiprocessing-address-formats:
2644 .. _multiprocessing-auth-keys:
2665 This means that (by default) all processes of a multi-process program will share
2690 parent process's logger -- any other customization of the logger will not be
2710 [INFO/SyncManager-...] child process calling self.run()
2711 [INFO/SyncManager-...] created temp directory /.../pymp-...
2712 [INFO/SyncManager-...] manager serving at '/.../listener-...'
2715 [INFO/SyncManager-...] manager exiting with exitcode 0
2737 .. class:: ThreadPool([processes[, initializer[, initargs]]])
2749 If *initializer* is not ``None`` then each worker process will call
2750 ``initializer(*initargs)`` when it starts.
2770 .. _multiprocessing-programming:
2773 ----------------------
2847 put items on the queue will terminate. Remember also that non-daemonic
2911 in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted
2912 in issues with processes-in-processes. This has been changed to::
2919 to applications which replace :func:`sys.stdin` with a "file-like object"
2921 :meth:`~io.IOBase.close()` on this file-like object, it could result in the same
2924 If you write a file-like object and implement your own caching, you can
2925 make it fork-safe by storing the pid whenever you append to the cache,
2961 .. _multiprocessing-safe-main-import:
3005 .. _multiprocessing-examples:
3008 --------