[Python-Dev] Should Python #define _POSIX_THREADS?

Jason Tishler Jason.Tishler@dothill.com
Wed, 4 Apr 2001 10:20:11 -0400


Recently significant pthreads support has been added to Cygwin.  When I
attempted to build a Cygwin Python with threads, I got the following
compilation error:

    gcc -c -g -O2 -Wall -Wstrict-prototypes -I. -I./Include -DHAVE_CONFIG_H -o Python/pythonrun.o Python/pythonrun.c
    In file included from /usr/include/signal.h:8,
                     from Python/pythonrun.c:21:
    /usr/include/sys/signal.h:162: parse error before `thread'

Cygwin's sys/signal has the following at line 162:

    #if defined(_POSIX_THREADS)
    int _EXFUN(pthread_kill, (pthread_t thread, int sig));
    #endif

The author of the recent Cygwin pthreads enhancements states that
_POSIX_THREADS is a kernel level #define and should not be defined in
user level code.  Please see the following for his reasoning:

    http://sources.redhat.com/ml/cygwin/2001-03/msg01693.html

Unfortunately, I am not knowledgeable is this area.  Can someone please
confirm or refute the above claim?

If it is concluded that Python should not #define _POSIX_THREADS, then I
am willing to generate a patch to substitute _POSIX_THREADS with a more
benign symbol in the less than 20 occurrences that my grep-ing found.
Any suggestions on what to call this new symbol?

Will such a patch be considered this late in the release cycle?  Or,
should I hold off until after 2.1 final?  If the patch is accepted into
2.1, then users can get a Cygwin Python with thread support without
having to wait for 2.2 or working off of CVS.

Thanks,
Jason

-- 
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corp.               Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com