Python 2.6, multiprocessing module and BSD

Jesse Noller jnoller at gmail.com
Wed Oct 22 10:11:58 EDT 2008


On Tue, Oct 21, 2008 at 6:45 PM,  <YouCanCallMeAl at gmail.com> wrote:
> It seems that the multiprocessing module in 2.6 is broken for *BSD;
> I've seen issue 3770 regarding this. I'm curious if there are more
> details on this issue since the posts in 3770 were a bit unclear. For
> example, one post claimed that the problem was that sem_open isn't
> implemented in *BSD, but it is available on FreeBSD 7 (I checked). I'd
> be willing to help get this working if someone could point me in the
> right direction.
> --
> http://mail.python.org/mailman/listinfo/python-list
>

The BSD issue was raised late in the cycle for 2.6. The problem is
that FBSD's support is "very experimental" as Phillip points out - and
OpenBSD doesn't even have them.

Due to the lateness of the issue and a finite amount of time I have to
work on things, I chose to disable support for this on the various
*BSDs until I can cook up a stable patch or have one provided by
someone more familiar with the inner workings of Free-BSD. OpenBSD
support is a non-starter.

Ideally, I would like to get this fixed and put on the 2.6 maint
branch ASAP, but I haven't had a chance to circle back to it.

Also note Nick's comment in that bug: "Unfortunately, our OpenBSD and
FreeBSD buildbots are so unreliable that they don't get much attention
when they go red"

Stable reliable buildbots and a few more volunteers more familiar with
BSDs might be a great and welcome addition to python-dev.

As for getting this working - I would love a patch. You are going to
want to start with python-trunk and look in setup.py. You are going to
want to adjust the flags the package uses:

        elif platform in ('freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):
            # FreeBSD's P1003.1b semaphore support is very experimental
            # and has many known problems. (as of June 2008)
            macros = dict(                  # FreeBSD
                HAVE_SEM_OPEN=0,
                HAVE_SEM_TIMEDWAIT=0,
                HAVE_FD_TRANSFER=1,
                )
            libraries = []

You will also need to look at: Lib/multiprocessing/synchronize.py to
disable the import error - Modules/_multiprocessing/multiprocessing.h
will need to be updated for the proper ifdefs for the bsd(s) as well.
Finally, the core of the semaphore usage is in
Modules/_multiprocessing/semaphore.c

I apologize we/I could not get this in for 2.6

-jesse



More information about the Python-list mailing list