• Home
  • Raw
  • Download

Lines Matching refs:multiprocessing

1 :mod:`multiprocessing` --- Process-based "threading" interface
4 .. module:: multiprocessing
13 :mod:`multiprocessing` is a package that supports spawning processes using an
14 API similar to the :mod:`threading` module. The :mod:`multiprocessing` package
17 to this, the :mod:`multiprocessing` module allows the programmer to fully
21 The :mod:`multiprocessing` module also introduces APIs which do not have
30 from multiprocessing import Pool
47 In :mod:`multiprocessing`, processes are spawned by creating a :class:`Process`
52 from multiprocessing import Process
64 from multiprocessing import Process
85 necessary, see :ref:`multiprocessing-programming`.
91 :mod:`multiprocessing` supports two types of communication channel between
96 The :class:`~multiprocessing.Queue` class is a near clone of :class:`Queue.Queue`. For
99 from multiprocessing import Process, Queue
118 from multiprocessing import Process, Pipe
143 :mod:`multiprocessing` contains equivalents of all the synchronization
147 from multiprocessing import Process, Lock
172 :mod:`multiprocessing` provides a couple of ways of doing so.
179 from multiprocessing import Process, Value, Array
208 :mod:`multiprocessing.sharedctypes` module which supports the creation of
220 :class:`Event`, :class:`~multiprocessing.Queue`, :class:`Value` and :class:`Array`. For
223 from multiprocessing import Process, Manager
258 The :class:`~multiprocessing.pool.Pool` class represents a pool of worker
264 from multiprocessing import Pool, TimeoutError
298 print "We lacked patience and got a multiprocessing.TimeoutError"
306 importable by the children. This is covered in :ref:`multiprocessing-programming`
311 >>> from multiprocessing import Pool
335 The :mod:`multiprocessing` package mostly replicates the API of the
441 When :mod:`multiprocessing` is initialized the main process is assigned a
448 See :ref:`multiprocessing-auth-keys`.
475 >>> import multiprocessing, time, signal
476 >>> p = multiprocessing.Process(target=time.sleep, args=(1000,))
509 The :class:`~multiprocessing.Queue`, :class:`multiprocessing.queues.SimpleQueue` and :class:`Joinab…
511 standard library. They differ in that :class:`~multiprocessing.Queue` lacks the
521 :ref:`multiprocessing-managers`.
525 :mod:`multiprocessing` uses the usual :exc:`Queue.Empty` and
527 the :mod:`multiprocessing` namespace so you need to import them from
537 :ref:`manager <multiprocessing-managers>`.
552 while it is trying to use a :class:`~multiprocessing.Queue`, then the data in the queue is
560 <multiprocessing.Queue.cancel_join_thread>`), then that process will
569 :ref:`multiprocessing-programming`.
572 :ref:`multiprocessing-examples`.
595 :class:`~multiprocessing.Queue` implements all the methods of :class:`Queue.Queue` except for
601 multithreading/multiprocessing semantics, this number is not reliable.
609 multithreading/multiprocessing semantics, this is not reliable.
614 multithreading/multiprocessing semantics, this is not reliable.
645 :class:`~multiprocessing.Queue` has a few additional methods not found in
689 .. class:: multiprocessing.queues.SimpleQueue()
691 It is a simplified :class:`~multiprocessing.Queue` type, very close to a locked :class:`Pipe`.
708 :class:`JoinableQueue`, a :class:`~multiprocessing.Queue` subclass, is a queue which
760 Add support for when a program which uses :mod:`multiprocessing` has been
767 from multiprocessing import Process, freeze_support
797 :mod:`multiprocessing` contains no analogues of
810 :ref:`multiprocessing-listeners-clients`.
890 >>> from multiprocessing import Pipe
917 :ref:`multiprocessing-auth-keys`.
934 object -- see :ref:`multiprocessing-managers`.
954 object from :mod:`multiprocessing`.
974 :class:`multiprocessing.Lock` as it applies to either processes or threads,
978 instance of ``multiprocessing.synchronize.Lock`` initialized with a
1026 instance of ``multiprocessing.synchronize.RLock`` initialized with a
1113 :mod:`multiprocessing.synchronize` module will be disabled, and attempts to
1179 The :mod:`multiprocessing.sharedctypes` module
1182 .. module:: multiprocessing.sharedctypes
1185 The :mod:`multiprocessing.sharedctypes` module provides functions for allocating
1236 :class:`~multiprocessing.Lock` or :class:`~multiprocessing.RLock` object
1251 synchronize access to the value. If *lock* is a :class:`~multiprocessing.Lock` or
1252 :class:`~multiprocessing.RLock` object then that will be used to synchronize access to the
1268 :class:`multiprocessing.RLock` object is created automatically.
1295 from multiprocessing import Process, Lock
1296 from multiprocessing.sharedctypes import Value, Array
1349 .. function:: multiprocessing.Manager()
1351 Returns a started :class:`~multiprocessing.managers.SyncManager` object which
1356 .. module:: multiprocessing.managers
1361 :mod:`multiprocessing.managers` module:
1389 >>> from multiprocessing.managers import BaseManager
1400 >>> from multiprocessing.managers import BaseManager
1459 :func:`multiprocessing.Manager`.
1552 >>> manager = multiprocessing.Manager()
1568 from multiprocessing.managers import BaseManager
1598 >>> from multiprocessing.managers import BaseManager
1609 >>> from multiprocessing.managers import BaseManager
1619 >>> from multiprocessing.managers import BaseManager
1631 >>> from multiprocessing import Process, Queue
1632 >>> from multiprocessing.managers import BaseManager
1664 >>> from multiprocessing import Manager
1698 The proxy types in :mod:`multiprocessing` do nothing to support comparisons
1780 .. module:: multiprocessing.pool
1786 .. class:: multiprocessing.Pool([processes[, initializer[, initargs[, maxtasksperchild]]]])
1861 ``next(timeout)`` will raise :exc:`multiprocessing.TimeoutError` if the
1896 :exc:`multiprocessing.TimeoutError` is raised. If the remote call raised
1914 from multiprocessing import Pool
1934 print result.get(timeout=1) # raises multiprocessing.TimeoutError
1942 .. module:: multiprocessing.connection
1946 :class:`~multiprocessing.Connection` objects returned by
1947 :func:`~multiprocessing.Pipe`.
1949 However, the :mod:`multiprocessing.connection` module allows some extra
1975 *address*, returning a :class:`~multiprocessing.Connection`.
1979 *address*. (See :ref:`multiprocessing-address-formats`)
1985 :ref:`multiprocessing-auth-keys`.
2008 :ref:`multiprocessing-address-formats`. Note that if *family* is
2026 :exc:`AuthenticationError` is raised. See :ref:`multiprocessing-auth-keys`.
2031 object and return a :class:`~multiprocessing.Connection` object. If
2033 :exc:`~multiprocessing.AuthenticationError` is raised.
2066 from multiprocessing.connection import Listener
2087 from multiprocessing.connection import Client
2129 When one uses :meth:`Connection.recv <multiprocessing.Connection.recv>`, the
2142 :class:`~multiprocessing.Process`). This value will be automatically inherited by
2143 any :class:`~multiprocessing.Process` object that the current process creates.
2158 .. currentmodule:: multiprocessing
2161 Returns the logger used by :mod:`multiprocessing`. If necessary, a new one
2172 .. currentmodule:: multiprocessing
2182 >>> import multiprocessing, logging
2183 >>> logger = multiprocessing.log_to_stderr()
2187 >>> m = multiprocessing.Manager()
2195 In addition to having these two logging functions, the multiprocessing also
2211 within the multiprocessing module. Below is the same example as above, except
2214 >>> import multiprocessing, logging
2215 >>> logger = multiprocessing.log_to_stderr()
2216 >>> logger.setLevel(multiprocessing.SUBDEBUG)
2219 >>> m = multiprocessing.Manager()
2233 The :mod:`multiprocessing.dummy` module
2236 .. module:: multiprocessing.dummy
2239 :mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` but is
2249 :mod:`multiprocessing`.
2279 :func:`~multiprocessing.active_children` is called) all completed processes
2281 process's :meth:`Process.is_alive <multiprocessing.Process.is_alive>` will
2287 On Windows many types from :mod:`multiprocessing` need to be picklable so
2295 Using the :meth:`Process.terminate <multiprocessing.Process.terminate>`
2302 :meth:`Process.terminate <multiprocessing.Process.terminate>` on processes
2310 :meth:`~multiprocessing.Queue.cancel_join_thread` method of the queue to avoid this behaviour.)
2320 from multiprocessing import Process, Queue
2349 from multiprocessing import Process, Lock
2361 from multiprocessing import Process, Lock
2373 :mod:`multiprocessing` originally unconditionally called::
2377 in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted
2416 Also, if you subclass :class:`~multiprocessing.Process` then make sure that
2418 <multiprocessing.Process.start>` method is called.
2425 <multiprocessing.Process.start>` was called.
2439 from multiprocessing import Process
2450 from multiprocessing import Process, freeze_support
2480 Using :class:`~multiprocessing.pool.Pool`:
2503 Some simple benchmarks comparing :mod:`multiprocessing` with :mod:`threading`: