From owner-freebsd-threads@FreeBSD.ORG Tue Dec 29 09:24:37 2009 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91BEC1065672; Tue, 29 Dec 2009 09:24:37 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7EE238FC17; Tue, 29 Dec 2009 09:24:37 +0000 (UTC) Received: from apple.my.domain (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nBT9OZQ8051762; Tue, 29 Dec 2009 09:24:36 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4B39CAD3.6090704@freebsd.org> Date: Tue, 29 Dec 2009 17:24:35 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080612) MIME-Version: 1.0 To: Alexander Kabaev References: <4B317741.8080004@freebsd.org> <200912240759.47703.jhb@freebsd.org> <4B385BB9.3010109@freebsd.org> <200912281121.30939.jhb@freebsd.org> <20091228150423.201936b4@kan.dnsalias.net> In-Reply-To: <20091228150423.201936b4@kan.dnsalias.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Daniel Eischen , freebsd-threads@freebsd.org Subject: Re: first patch for process-shared semaphore X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 09:24:37 -0000 Alexander Kabaev wrote: >>> May I can move all semaphore functions into libc and remove all >>> semaphore related symbols from libthr ? In pratical, this is not a >>> problem, because libthr itself is not dlopen-safe, all missing >>> semaphore functions in libthr will be found in libc by rtld. >> I would go with this approach. There is also some discussion about >> moving all of libthr into libc as well and having a dummy libpthread >> now that we are back to a single threading library and to avoid >> issues with dlopen() of libpthread, etc. >> > > Removing symbols from library, versioned library especially, is a big > wrong. You should provide compat symbols for all functions that that > were there before. > I have updated the patch: http://people.freebsd.org/~davidxu/patch/shared_semaphore_2.patch this time, all semaphore code are moved into libc and libthr still has semaphore stubs. Also, now semaphore file is created in /tmp as name SEMD, this looks like Solaris does as jhb@ said, though the patch doesn't use lock file, but use the semaphore file itself.