[Python-Dev] RE: POSIX thread code and Cygwin
Gerald S. Williams
gsw@agere.com
2002年3月22日 16:34:31 -0500
Tim Peters wrote:
> I don't understand. If Cygwin requires _rtems_ in order that
> _POSIX_SEMAPHORES be defined, then either Cygwin has a bug here, or Cygwin
> *needs* _rtems_ if you want to use real-time gimmicks like semaphores. In
> either case, I don't think it's Python's place to second-guess the Cygwin
> team: report it as a bug to Cygwin, or do whatever they recommend to get
> _rtems_ defined in the Cygwin build.
_rtems_ is actually from newlib, not Cygwin.s
Here's the comment I added to SourceForge:
Before _POSIX_SEMAPHORES is specified by default for
Cygwin, it will probably have to be shown that it is 100%
compliant with POSIX. Whether or not this is the case, the
POSIX semaphore implementation is the one that should be
used for Cygwin (it has been verified and approved by the
Cygwin Python maintainer, etc.).
Prior to this, threading had been disabled for Cygwin
Python, so this is really more of a port-to-Cygwin than a
workaround. This could have been implemented in a new file
(thread_cygwin.h), although during implementation it was
discovered that the change for Cygwin would also benefit
POSIX semaphore users in general.
The threading module overall is highly platform-specific,
especially with regard to redefining POSIX symbols for
specific platforms. In particular, this is done for the
following platforms:
__DGUX
__sgi
__ksr__
anything using SOLARIS_THREADS
__MWERKS__
However, except for those using SOLARIS_THREADS, these are
specified in thread.c. I will therefore resubmit the patch
as a change to thread.c instead.
The reference to __rtems__ actually comes from newlib,
which Cygwin uses. It doesn't apply to Cygwin.
-O Gerald S. Williams, 22Y-103GA : mailto:gsw@agere.com O-
-O AGERE SYSTEMS, 555 UNION BLVD : office:610-712-8661 O-
-O ALLENTOWN, PA, USA 18109-3286 : mobile:908-672-7592 O-