From owner-freebsd-threads@FreeBSD.ORG Mon Dec 28 20:30:23 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 8B54D106568D; Mon, 28 Dec 2009 20:30:23 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by mx1.freebsd.org (Postfix) with ESMTP id 242F98FC08; Mon, 28 Dec 2009 20:30:22 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 9so2282657qwb.7 for ; Mon, 28 Dec 2009 12:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=TwR2F09iZsOw2gHztWbbRsFhugYL1nScfQLB/IKCFxI=; b=g6aQKGiAnJwY3wDHBVlvfHslgnDgElwNy361j9NdrkFepvIcyU6r+9J6jVY22qtRRE 8QKYoZYxOmMCfmzrAA6jDpzir8V0qH3awc3jMkOAXcsrZdjWDBCxyM19XqxmCOD4fm3z ehvmFP7vGvhQ8Bxpdz2bIYkkmuiISYpMUtckU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=etNsNKIYUIGjPyXq2YUOSYrz2qJj5K6bXAMQx78wfFVCbSgz5LdJvf2gA27HipPUWy HemP8uFhV4e7zSDJWf6jlRlAoFaL6G4/wrBvpf7kWrO96NUxK/0Iav3jtv0FEZge2DvT p93ZAxtLLSW2TrdCgbLiRehH+jEOCiezlTvxg= Received: by 10.224.41.84 with SMTP id n20mr7691357qae.205.1262030670081; Mon, 28 Dec 2009 12:04:30 -0800 (PST) Received: from kan.dnsalias.net (c-24-91-218-112.hsd1.ma.comcast.net [24.91.218.112]) by mx.google.com with ESMTPS id 5sm32435842qwg.8.2009.12.28.12.04.28 (version=SSLv3 cipher=RC4-MD5); Mon, 28 Dec 2009 12:04:28 -0800 (PST) Date: Mon, 28 Dec 2009 15:04:23 -0500 From: Alexander Kabaev To: John Baldwin Message-ID: <20091228150423.201936b4@kan.dnsalias.net> In-Reply-To: <200912281121.30939.jhb@freebsd.org> References: <4B317741.8080004@freebsd.org> <200912240759.47703.jhb@freebsd.org> <4B385BB9.3010109@freebsd.org> <200912281121.30939.jhb@freebsd.org> X-Mailer: Claws Mail 3.7.3 (GTK+ 2.18.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/sKORHipieJpQpE4DcbZMhid"; protocol="application/pgp-signature" Cc: Eischen , Daniel, David Xu , 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: Mon, 28 Dec 2009 20:30:23 -0000 --Sig_/sKORHipieJpQpE4DcbZMhid Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable 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. > > >=20 > > > 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=20 > semaphore. > > >=20 > > 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. >=20 > 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. >=20 Removing symbols from library, versioned library especially, is a big=20 wrong. You should provide compat symbols for all functions that that were there before. =20 --=20 Alexander Kabaev --Sig_/sKORHipieJpQpE4DcbZMhid Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iD8DBQFLOQ9LQ6z1jMm+XZYRApnrAKDK1kDOTKhtaXvotDFx/FF65w/TmACg7EAJ 7q8iXn24ZMHtwaFpZMkw4xo= =NVRk -----END PGP SIGNATURE----- --Sig_/sKORHipieJpQpE4DcbZMhid--