[Python-Dev] RE: POSIX thread code and Cygwin

Martin v. Loewis martin@v.loewis.de
23 Mar 2002 00:35:14 +0100


"Gerald S. Williams" <gsw@agere.com> writes:

> Before _POSIX_SEMAPHORES is specified by default for 
> Cygwin, it will probably have to be shown that it is 100% 
> compliant with POSIX. 

Please don't guess in such matters; this is not very convincing.

The Posix spec says this:

  An implementation that claims conformance to this Feature Group
  shall set the macro _XOPEN_REALTIME to a value other than -1. An
  implementation that does not claim conformance shall set
  _XOPEN_REALTIME to -1.

  The POSIX Realtime Extension defines the following symbolic
  constants and their meaning:

  ...
  _POSIX_SEMAPHORES
      Implementation supports the Semaphores option.

So the right way to not claim conformance is to set _XOPEN_REALTIME,
not to not set _POSIX_SEMAPHORES.

> The threading module overall is highly platform-specific, 
> especially with regard to redefining POSIX symbols for 
> specific platforms. 

Yes, this is a terrible thing. I think most of it should be ripped
out, since nobody can verify anymore which of this #ifdef mess is
still in use, and still doing the right thing on the platforms on
which it is activated.

Standards are there to implement them if they are useful, and to
simplify life of users of these standards; anybody not following
standards when they exist deserves to lose.

In any case, this #ifdef maze should not be extended.

Regards,
Martin