Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Feb 2012 14:29:43 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        Garrett Cooper <yanegomi@gmail.com>, freebsd-hackers@freebsd.org, Ivan Voras <ivoras@freebsd.org>, Xin LI <delphij@delphij.net>, Jan Mikkelsen <janm-freebsd-hackers@transactionware.com>, davidxu@freebsd.org
Subject:   Re: sem(4) lockup in python?
Message-ID:  <Pine.GSO.4.64.1202051428390.28760@sea.ntplx.net>
In-Reply-To: <20120205190022.GC57421@stack.nl>
References:  <jejrbe$or8$1@dough.gmane.org> <201201110806.30620.jhb@freebsd.org> <CAF-QHFWFvYTPeM68Mk%2BOYVX--MNhKOJ2o1GF9ZOsBmtiC5fYFQ@mail.gmail.com> <CAGH67wRsek2-WY_ETW6QEER1r5dDXLXfDjbzpHMjtv059Y8cJw@mail.gmail.com> <5D37298B-9D68-4F0F-8AAB-E8F2DBB9D9C3@transactionware.com> <CAGH67wT3HuxPHUXeTib0qJNH%2BO5snn3Eiim1bfj8LewYoKdXdA@mail.gmail.com> <CAF-QHFVADLkduLH1AG_hSZeDtDVCC=FkqZxbxrsMY3Y3%2BsMZ8A@mail.gmail.com> <Pine.GSO.4.64.1202051330020.28531@sea.ntplx.net> <20120205190022.GC57421@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---559023410-851401618-1328470183=:28760
Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Sun, 5 Feb 2012, Jilles Tjoelker wrote:

> On Sun, Feb 05, 2012 at 01:32:42PM -0500, Daniel Eischen wrote:
>> On Sun, 5 Feb 2012, Ivan Voras wrote:
>>> On 5 February 2012 11:44, Garrett Cooper <yanegomi@gmail.com> wrote:
>
>>>> =A0 =A0'make MAKE_JOBS_NUMBER=3D1' is the workground used right now..
>
>>> David Xu suggested that it is a bug in Python - it doesn't set
>>> process-shared attribute when it calls sem_init(), but i've tried
>>> patching it (replacing the port patchfile file the one I've attached)
>>> and I still get the hang.
>
>> I don't understand how process shared semaphores can work.  Perhaps
>> I'm dumb and ignorant, but a sem_id_t is an allocated struct.   The
>> actual kernel sem_id is inside the struct.  Isn't this the same
>> reason pthread_mutex_t and pthread_cond_t cannot be process-shared?
>
> That's how the old implementation works. It does not support
> process-shared semaphores although they may happen to work in some
> specific cases.
>
> However, in 9.0, sem_t works differently and contains the actual lock
> word directly, so that process-shared semaphores work. The
> implementation is in lib/libc/gen/sem_new.c. The pshared flag to
> sem_init() is not a no-op because it tells the kernel to allow for use
> from multiple processes.
>
> Note that the old implementation is still present as well, for
> compatibility with old binaries.

Ahh, okay, I was looking at the old implementation in libc.

--=20
DE
---559023410-851401618-1328470183=:28760--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.1202051428390.28760>