From owner-freebsd-threads@FreeBSD.ORG Fri Feb 4 21:33:08 2011 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 14BD1106566B; Fri, 4 Feb 2011 21:33:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 66E218FC13; Fri, 4 Feb 2011 21:33:06 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p14LX2xH036457 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 4 Feb 2011 23:33:03 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p14LX20r072408; Fri, 4 Feb 2011 23:33:02 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p14LX2MV072407; Fri, 4 Feb 2011 23:33:02 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 4 Feb 2011 23:33:02 +0200 From: Kostik Belousov To: Jung-uk Kim Message-ID: <20110204213302.GS78089@deviant.kiev.zoral.com.ua> References: <201102041409.12314.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="brdEIFGMNIjz5YJG" Content-Disposition: inline In-Reply-To: <201102041409.12314.jkim@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: davidxu@freebsd.org, freebsd-threads@freebsd.org Subject: Re: [RFC] Implement pthread_getthreadid_np(3) and pthread_getunique_np(3) 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: Fri, 04 Feb 2011 21:33:08 -0000 --brdEIFGMNIjz5YJG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 04, 2011 at 02:09:10PM -0500, Jung-uk Kim wrote: > Our pthread_t is not an integral type and it causes a lot of trouble=20 > porting some software, which relies on Linux's gettid() or similar=20 > syscalls: >=20 > http://www.kernel.org/doc/man-pages/online/pages/man2/gettid.2.html >=20 > For example: >=20 > http://docs.freebsd.org/cgi/mid.cgi?201102032111.13479.jkim >=20 > To solve this problem, I implemented two functions: >=20 > http://people.freebsd.org/~jkim/thr_tid.diff >=20 > Basically, they are AIX's pthread_getthreadid_np(3) and=20 > pthread_getunique_np(3) look-alikes: >=20 > http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/users_22= .htm > http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/users_23= .htm >=20 > Please let me know what you think. Why do you need new functions available in stubs ? Also, would it be better to return proper id even if threading is not initialized, instead of EINVAL ? --brdEIFGMNIjz5YJG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk1McI4ACgkQC3+MBN1Mb4gO5gCdHny6GVtd5btveH/0P70I6Hsy WrEAmwZO0Aw0vlR6udP5b+UeHsU43mag =JX5x -----END PGP SIGNATURE----- --brdEIFGMNIjz5YJG--