The dummy_thread module is called the _dummy_thread module in Python 3, and the Python 2to3 tool can help you automatically change the name of the module in the old code. However, it is more recommended to use a high-level dummy_threading module than this module.
As with the dummy_thread module, the Python 3 is called _dummy_threading,and thedummy_threading is the same interface as the threading module, designed for those that do not support The function of the threading module is provided on the platform of the thread module .
Python 2.7 dummy_thread module source code;
Python 2.7 dummy_threading module source code;
The interface of the module is the same as the thread module (renamed _thread module in Python 3), and the meaning of this module is that it provides the functionality of the thread module on a platform that does not implement the thread module.
Recommended usage
Dummy_thread
Try: import thread as _threadexcept importerror: import Dummy_thread as _thread
Dummy_threading
Try: import threading as _threadingexcept importerror: import dummy_threading as _threading
Be careful to avoid a thread that is being created to use these two modules because it waits for another thread that has not yet been created and thus causes a deadlock, which is more than blocking I/O.
Python--dummy_thread (_dummy_thread in Python 3.+)