dummy_threading.rst 784 Bytes
Newer Older
1 2 3 4 5 6
:mod:`dummy_threading` --- Drop-in replacement for the :mod:`threading` module
==============================================================================

.. module:: dummy_threading
   :synopsis: Drop-in replacement for the threading module.

Raymond Hettinger's avatar
Raymond Hettinger committed
7 8 9
**Source code:** :source:`Lib/dummy_threading.py`

--------------
10 11

This module provides a duplicate interface to the :mod:`threading` module.  It
12
is meant to be imported when the :mod:`_thread` module is not provided on a
13 14 15 16 17
platform.

Suggested usage is::

   try:
18
       import threading
19
   except ImportError:
20
       import dummy_threading as threading
21

22 23 24
Be careful to not use this module where deadlock might occur from a thread being
created that blocks waiting for another thread to be created.  This often occurs
with blocking I/O.
25