[Python-Dev] Clean up Python/thread_*.h ?

Antoine Pitrou solipsis at pitrou.net
Sat Oct 24 20:02:30 CEST 2009


I am wondering which of the files in Python/thread_*.h are really necessary
today. Looking at these files, I think most of them could perhaps be removed in
py3k. I've identified three categories of potentially removable files:

* The unused file: thread_wince.h

Windows CE has actually been using thread_nt.h since January 2009 (see
http://bugs.python.org/issue4893 ). thread_wince.h is still there, but it's
unused and grep brings no instance of it being mentioned anywhere in the source

* The (unsupported, untested?) files: thread_atheos.h, thread_cthread.h,
thread_lwp.h, thread_os2.h, thread_pth.h, thread_sgi.h.

These files refer to architectures which we probably have stopped caring about.
It is not even sure whether these files compile and work ok. Most of them have
not seen maintenance for years, except for the OS/2 file. In any case, it is
obvious they haven't received the level of attention and support that the
pthreads and NT versions have.
(also, according to http://www.lesstif.org/~amai/os2/html/porting.html, there is
a pthreads interface available for OS/2)

* The questionable files: thread_pth.h, thread_solaris.h.

GNU pth is probably obsolete on all platforms and superseced by the pthreads
API. According to http://www.gnu.org/software/pth/, the last pth version was
released in 2006 (and the changelog is rather unimpressive).
As for Solaris, according to the Sun website it should provide the pthreads API.
It was already documented in a 1999 manpage for SunOS 5.9:
http://docs.sun.com/app/docs/doc/816-0216/6m6ngupon?a=view .

Making a decision and removing the files considered unnecessary would clarify
what platforms still are/should be supported. Having less supported platforms
would also make improvements easier. Right now making an addition to the core
threading primitives is almost impossible since it would require to provide all
those platform-specific versions which almost nobody is competent for.



More information about the Python-Dev mailing list