[Patches] [ python-Patches-711835 ] Removing unnecessary lock operations

SourceForge.net noreply@sourceforge.net
Mon, 31 Mar 2003 10:21:04 -0800


Patches item #711835, was opened at 2003-03-29 11:12
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=711835&group_id=5470

Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: Accepted
Priority: 5
Submitted By: Mihai Ibanescu (misa)
Assigned to: Martin v. Löwis (loewis)
Summary: Removing unnecessary lock operations

Initial Comment:
PyThread_acquire_lock can be further optimized to do
less locking on the global lock mutex.

Original patch location:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=86281

----------------------------------------------------------------------

>Comment By: Mihai Ibanescu (misa)
Date: 2003-03-31 13:21

Message:
Logged In: YES 
user_id=205865

One of the glibc developers expressed some concern on the
2.3 implementation of the global lock using semaphores. I'd
be glad to  funnel any communication with the glibc community.

<quote>
(you) should do some timings on the current lock
implementation vs the one using semaphores.

POSIX semaphores have special requirements (e.g., sem_post
must be callable in signal handlers) which make semaphores
pretty expensive.  In NPTL, for instance, sem_post always
makes a syscall, there is no userlevel-only path.  This
makes using semaphores pretty expensive.  The same
restricting applies in one form or another to all POSIX
compliant semaphore implementations.
</quote>

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2003-03-31 12:23

Message:
Logged In: YES 
user_id=31435

I marked this as Accepted, and also don't see any problem 
with backporting to the 2.2 line.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-03-31 00:25

Message:
Logged In: YES 
user_id=21627

There are plans to provide Python 2.2.3. I see no problem
applying it to 2.2.2, as there shouldn't be any change in
visible behaviour.

----------------------------------------------------------------------

Comment By: Mihai Ibanescu (misa)
Date: 2003-03-30 22:59

Message:
Logged In: YES 
user_id=205865

Also, this happens in 2.2.2 as well (the patch in Red Hat's
bugzilla is against 2.2.2 actually). Is there a plan to
release a 2.2.3? Is there value in backporting the patch?
(should apply cleanly on 2.2.2).

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-03-30 17:19

Message:
Logged In: YES 
user_id=33168

_POSIX_SEMAPHORES aren't used if
HAVE_BROKEN_POSIX_SEMAPHORES is defined.  This currently
occurs on Solaris 8 (at least).

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2003-03-30 17:11

Message:
Logged In: YES 
user_id=31435

Looks fine to me too.  Since Python switched to using 
semaphores on Linux for 2.3, it's unclear that there's a 
system that uses the condvar code anymore.  How will this 
get tested?

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-03-30 11:49

Message:
Logged In: YES 
user_id=21627

This looks reasonable to me, but I may be missing something.

Tim, can you see a problem with that code?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=711835&group_id=5470