From owner-freebsd-threads@FreeBSD.ORG Tue Dec 29 00:44:14 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 3BCFE1065693; Tue, 29 Dec 2009 00:44:14 +0000 (UTC) (envelope-from eischen@vigrid.com) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id DD8028FC13; Tue, 29 Dec 2009 00:44:15 +0000 (UTC) Received: from [10.0.0.18] (ip-414b102e.ct.fixed.ntplx.com [65.75.16.46]) (authenticated bits=0) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id nBT0L2N3026650 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 28 Dec 2009 19:21:05 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Mon, 28 Dec 2009 19:21:06 -0500 (EST) References: <4B317741.8080004@freebsd.org> <200912240759.47703.jhb@freebsd.org> <4B385BB9.3010109@freebsd.org> <200912281121.30939.jhb@freebsd.org> <20091228150423.201936b4@kan.dnsalias.net> Message-Id: From: Daniel Eischen To: Alexander Kabaev In-Reply-To: <20091228150423.201936b4@kan.dnsalias.net> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Date: Mon, 28 Dec 2009 19:20:59 -0500 Cc: Eischen , "freebsd-threads@freebsd.org" , "Daniel@freebsd.org" , David Xu 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 00:44:14 -0000 On Dec 28, 2009, at 3:04 PM, Alexander Kabaev wrote: > On Mon, 28 Dec 2009 11:21:30 -0500 > John Baldwin wrote: > >> On Monday 28 December 2009 2:18:17 am David Xu wrote: >>> John Baldwin wrote: >>>> On Wednesday 23 December 2009 10:12:19 pm Alexander Kabaev wrote: >>>>> On Thu, 24 Dec 2009 09:58:50 +0800 >>>>> David Xu wrote: >>>>> >>>>>> Alexander Kabaev wrote: >>>>>>> On Thu, 24 Dec 2009 09:22:34 +0800 >>>>>>> David Xu wrote: >>>>>>>> libthr does not require semaphore, it implements semaphore, >>>>>>>> it is easier than other ways to implement the process-shared. >>>>>>>> >>>>>>> Let me rephrase: I do not think semaphores belong in libthr. >>>>>>> They should be either in libc or in librt. >>>>>>> >>>>>>> >>>>>> OK, does others really implement semaphore in librt ? >>>>>> unfortunately, the librt already requires libpthread to >>>>>> implement SIGEV_THREAD. >>>>> I retract that. It appears that there is no consistency - >>>>> Solaris put these into libc, Linux into libpthread ans SUSv2 >>>>> hints that these belong with realtime functions. libthr is fine. >>>> >>>> I vote for libc. Single-threaded processes can use sem_open() >>>> and PSHARED sem_init() as well. Single-threaded processes can >>>> even use non-PSHARED sem_init() by using fork() to create new >>>> "threads" that share the >> semaphore. >>>> >>> 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 tend to agree. I also don't understand the desire to include libthr in libc. Other than dlopen()ing libpthread (which can be worked around other ways), I don't understand why we would need or want this. -- DE