Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: pkgsrc/lang/python26



Matthias Drochner <M.Drochner%fz-juelich.de@localhost> wrote:
> I've seen problems with ipython. It seems that there is something
> in Python which closes all file descriptors >2 in a "for" loop,
> probably in the course of an "exec". This made that following
> accesses to semaphores failed.
> Other problems were with xen - "xend" died from locking problems
> on certain operations, in particular when I tried to start an
> HVM domain.
> 
> The problem did probably start when libpthread started to use
> "ksem" kernel semaphores which was after the netbsd-6 branch.
> This means that netbsd-6 is likely not affected.
> 
> IMHO the whole design is fundamentally broken - a close(2) should
> not affect semaphores. (And the other way, a sem_close(3) should
> not be able to close file descriptors.) Another nonstandard
> behavior is that the semaphores don't close-on-exec (but should,
> according to POSIX). This is easily fixed - I did it locally, but
> it didn't fix any of the problems observed.

No, it is not.  It is fully legitimate to implement them using
file descriptors or whatever else.  Such implementation was also
simpler and cleaner.

Also, our POSIX semaphore behaviour (and use of file descriptor)
matches OS X and more or less FreeBSD.  Linux uses memory mapped
file on tmpfs (and keeps the file descriptor internally) and so
does Solaris.

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index