Thread vs. Threading

banx picture banx · Apr 6, 2011 · Viewed 31.1k times · Source

What's the difference between the threading and thread modules in Python?

Answer

ncoghlan picture ncoghlan · Apr 7, 2011

In Python 3, thread has been renamed to _thread. It is infrastructure code that is used to implement threading, and normal Python code shouldn't be going anywhere near it.

_thread exposes a fairly raw view of the underlying OS level processes. This is almost never what you want, hence the rename in Py3k to indicate that it is really just an implementation detail.

threading adds some additional automatic accounting, as well as several convenience utilities, all of which makes it the preferred option for standard Python code.