Semaphores?

Aahz Maruch aahz at panix.com
Tue Aug 28 01:57:05 EDT 2001


In article <7xofp0sqnm.fsf at ruckus.brouhaha.com>,
Paul Rubin  <phr-n2001 at nightsong.com> wrote:
>aahz at panix.com (Aahz Maruch) writes:
>>Paul Rubin:
>>>
>>>Anyone got a favorite way to implement shared memory semaphores in
>>>Python?  The obvious way is with an atomic test-and-set operation in
>>>the mmap module, but none seems to be listed in the docs.  Is there a
>>>preferred way to do it?  If not, should I submit a PEP to add
>>>something to mmap?
>> 
>> Do you have a cross-platform solution?
>
>There's no totally portable way to do it (it's not part of C
>semantics) but there should be reasonable implementations possible on
>all modern platforms.

Ah.  Well, let me channel Tim and Guido and tell you to come back when
you have a patch that supports the following platforms:

Linux
Windows
Mac OS X
Solaris
HP-UX

Portability is one of Python's prime virtues, and I know that Guido and
team *hate* maintaining lots of platform-specific code.  Do feel free to
write up the PEP, though; having a design spec is one of the necessary
requisites for getting anywhere.
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

"Plus ca change, plus c'est la meme chose."



More information about the Python-list mailing list