for synchronizing access to shared objects with locks this book presents both the _thread and threading modulesand its examples use both interchangeably some python users would recommend that you always use threading rather than _thread in general in factthe latter was renamed from thread to _thread in to suggest such lesser status for it personallyi think that is too extreme (and this is one reason this book sometimes uses as thread in imports to retain the original module nameunless you need the more powerful tools in threadingthe choice is largely arbitraryand the threading module' extra requirements may be unwarranted the basic thread module does not impose oopand as you'll see in the examples of this sectionis very straightforward to use the threading module may be better for more complex tasks which require per-thread state retention or joinsbut not all threaded programs require its extra toolsand many use threads in more limited scopes in factthis is roughly the same as comparing the os walk call and visitor classes we'll meet in --both have valid audiences and use cases the most general python rule of thumb applies here as alwayskeep it simpleunless it has to be complex the _thread module since the basic _thread module is bit simpler than the more advanced threading module covered later in this sectionlet' look at some of its interfaces first this module provides portable interface to whatever threading system is available in your platformits interfaces work the same on windowssolarissgiand any system with an installed pthreads posix threads implementation (including linux and otherspython scripts that use the python _thread module work on all of these platforms without changing their source code basic usage let' start off by experimenting with script that demonstrates the main thread interfaces the script in example - spawns threads until you reply with at the consoleit' similar in spirit to (and bit simpler thanthe script in example - but it goes parallel with threads instead of process forks example - pp \system\threads\thread py "spawn threads until you type ' 'import _thread def child(tid)threads