This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Apply semaphore code to Cygwin
Type: Stage:
Components: Interpreter Core Versions: Python 2.2
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: gsw_agere, loewis, tim.peters
Priority: normal Keywords: patch

Created on 2002-03-22 17:20 by gsw_agere, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
thread_pthread.h.diff-c gsw_agere, 2002-03-22 17:20 Specify semaphore use for Cygwin Python
thread.c.diff-c gsw_agere, 2002-03-22 21:18
thread.c.diff-c gsw_agere, 2002-03-22 21:19
Messages (6)
msg39331 - (view) Author: Gerald S. Williams (gsw_agere) Date: 2002-03-22 17:20
The current version of Cygwin does not define 
_POSIX_SEMAPHORES by default, although requires the 
new semaphore interface since its condition variables 
interface contains a race condition.

This patch simply specifies that semaphores should be 
used if _POSIX_SEMAPHORES OR __CYGWIN__ is defined.
msg39332 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-03-22 20:03
Logged In: YES 
user_id=21627

-1. Cygwin really ought to define _POSIX_SEMAPHORES if they
support them, so if they support them and don't define the
feature test macro, it is a Cygwin bug. Work-arounds around
platform bugs are generally discourgaged in Python.

On python-dev, you indicate that _POSIX_SEMPAPHORES is only
defined if __rtems__ is also defined. What is the rationale
for that?
msg39333 - (view) Author: Gerald S. Williams (gsw_agere) Date: 2002-03-22 21:18
Logged In: YES 
user_id=329402

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.
msg39334 - (view) Author: Gerald S. Williams (gsw_agere) Date: 2002-03-22 21:19
Logged In: YES 
user_id=329402

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.
msg39335 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2002-03-22 21:28
Logged In: YES 
user_id=31435

I'm afraid I agree with Martin here:  the crusty old 
historical examples you dug up are exactly why we avoid 
doing similar stuff now.  Nobody understands why that code 
is there anymore, and it will never go away.  For example, 
I happen to know that KSR went bankrupt in 1994, and 
anything keying off __ksr__ has been worse than useless 
since then.
msg39336 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2002-03-25 06:42
Logged In: YES 
user_id=31435

I'm rejecting the patch based on Jason Tishler's comments 
in:

http://mail.python.org/pipermail/python-dev/2002-
March/021675.html

Please work with Jason to find a better solution.  If you 
and Jason can't find a better one, and Jason goes along 
with this patch, we can reopen it.

In the meantime, you motivated me to get rid of the old 
__ksr__ cruft <wink>.
History
Date User Action Args
2022-04-10 16:05:08adminsetgithub: 36314
2002-03-22 17:20:48gsw_agerecreate