[Python-Dev] Issue #10348: concurrent.futures doesn't work on BSD (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Thu Dec 30 19:17:08 CET 2010


1. Does it still fail on FreeBSD 7.3+?

Yes, it still fails. The limits (30 semaphores) haven't changed. It also remains untunable.

2. Why is the semaphore limit so low in the first place?

I don't know - (Free)BSD is in the tradition of disliking SysV inventions, and POSIX inventions unless they originate from FreeBSD. This is polemics, of course :-)

In any case, SysV IPC doesn't seem much better. In SysV, you allocate semaphores in sets. In FreeBSD 8.1, in the standard setting, you can have up to 10 semaphore identifiers, with up to 60 semaphores each. That may sound reasonable, except that there is also a limit on the total number of semaphores of 60.

So it seems that switching to SysV IPC wouldn't actually improve things (except that these are tunable parameters already, so changing them requires only a reboot, not a recompile of the kernel).

3. What is a reasonable number for that limit? That should include situations where people run multiple applications.

POSIX specifies that the minimum acceptable value for the SEM_NSEMS_MAX setting is _POSIX_SEM_NSEMS_MAX, which in turn must be at least 256. We could argue that we refuse to use POSIX semaphores if the system doesn't conform to POSIX, i.e. has semaphore limit of less than 256.

Regards, Martin



More information about the Python-Dev mailing list