• Home
  • Raw
  • Download

Lines Matching +full:set +full:- +full:blocking

1 :mod:`threading` --- Higher-level threading interface
5 :synopsis: Higher-level threading interface.
9 --------------
11 This module constructs higher-level threading interfaces on top of the lower
23 :mod:`multiprocessing` module. However, no schedule has been set for the
32 .. impl-detail::
35 can execute Python code at once (even though certain performance-oriented
38 resources of multi-core machines, you are advised to use
40 if you want to run multiple I/O-bound tasks simultaneously.
62 See :ref:`condition-objects`.
89 that can be set to true with the :meth:`~Event.set` method and reset to false
93 See :ref:`event-objects`.
98 A class that represents thread-local data. Thread-local data are data whose
99 values are thread specific. To manage thread-local data, just create an
119 See :ref:`lock-objects`.
126 reentrant lock, the same thread may acquire it again without blocking; the
129 See :ref:`rlock-objects`.
141 See :ref:`semaphore-objects`.
159 See :ref:`thread-objects`.
167 See :ref:`timer-objects`.
174 Set a trace function for all threads started from the :mod:`threading` module.
185 Set a profile function for all threads started from the :mod:`threading` module.
205 memory page size - platform documentation should be referred to for more
215 Raised for various threading-related errors as described below. Note that
227 when implemented, are mapped to module-level functions.
232 .. _thread-objects:
235 --------------
249 stops being alive when its :meth:`run` method terminates -- either normally, or
261 initial value is inherited from the creating thread. The flag can be set
267 If you want your threads to stop gracefully, make them non-daemonic and
293 form "Thread-*N*" where *N* is a small decimal number.
326 thread whose :meth:`join` method is called terminates -- either normally
327 or through an unhandled exception -- or until the optional timeout occurs.
333 happened -- if the thread is still alive, the :meth:`join` call timed out.
348 Multiple threads may be given the same name. The initial name is set by
356 Pre-2.6 API for :attr:`~Thread.name`.
383 or not (False). This must be set before :meth:`start` is called,
389 The entire Python program exits when no alive non-daemon threads are left.
396 Pre-2.6 API for :attr:`~Thread.daemon`.
399 .. _lock-objects:
402 ------------
427 .. method:: Lock.acquire([blocking])
429 Acquire a lock, blocking or non-blocking.
431 When invoked with the *blocking* argument set to ``True`` (the default),
432 block until the lock is unlocked, then set it to locked and return ``True``.
434 When invoked with the *blocking* argument set to ``False``, do not block.
435 If a call with *blocking* set to ``True`` would block, return ``False``
436 immediately; otherwise, set the lock to locked and return ``True``.
452 .. _rlock-objects:
455 -------------
471 .. method:: RLock.acquire([blocking=1])
473 Acquire a lock, blocking or non-blocking.
478 unlocked (not owned by any thread), then grab ownership, set the recursion level
483 When invoked with the *blocking* argument set to true, do the same thing as when
486 When invoked with the *blocking* argument set to false, do not block. If a call
506 .. _condition-objects:
509 -----------------
523 another thread. Once awakened, it re-acquires the lock and returns. It is also
541 code is a generic producer-consumer situation with unlimited buffer capacity::
558 in a typical producer-consumer situation, adding one item to the buffer only
586 occurs. Once awakened or timed out, it re-acquires the lock and returns.
607 variable; it is a no-op if no threads are waiting.
630 .. _semaphore-objects:
633 -----------------
651 .. method:: acquire([blocking])
664 When invoked with *blocking* set to true, do the same thing as when called
667 When invoked with *blocking* set to false, do not block. If a call
678 .. _semaphore-examples:
705 .. _event-objects:
708 -------------
713 An event object manages an internal flag that can be set to true with the
714 :meth:`~Event.set` method and reset to false with the :meth:`~Event.clear`
730 .. method:: set()
732 Set the internal flag to true. All threads waiting for it to become true
739 :meth:`wait` will block until :meth:`.set` is called to set the internal
746 :meth:`.set` to set the flag to true, or until the optional timeout
760 .. _timer-objects:
763 -------------
766 of time has passed --- a timer. :class:`Timer` is a subclass of :class:`Thread`
795 .. _with-locks:
798 ------------------------------------------------------------------------
817 .. _threaded-imports:
820 --------------------------
822 While the import machinery is thread-safe, there are two key restrictions on
823 threaded imports due to inherent limitations in the way that thread-safety is
832 performing imports from non-daemon threads created through the threading