From owner-freebsd-threads@FreeBSD.ORG Mon Feb 7 11:07:11 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 149CC1065679 for ; Mon, 7 Feb 2011 11:07:11 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DD1988FC1E for ; Mon, 7 Feb 2011 11:07:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p17B7AKC027890 for ; Mon, 7 Feb 2011 11:07:10 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p17B7Ad0027888 for freebsd-threads@FreeBSD.org; Mon, 7 Feb 2011 11:07:10 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 7 Feb 2011 11:07:10 GMT Message-Id: <201102071107.p17B7Ad0027888@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-threads@FreeBSD.org 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, 07 Feb 2011 11:07:11 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o threa/150959 threads [libc] Stub pthread_once in libc should call _libc_onc o threa/149366 threads pthread_cleanup_pop never runs the configured routine o threa/148515 threads Memory / syslog strangeness in FreeBSD 8.x ( possible o threa/141721 threads rtprio(1): (id|rt)prio priority resets when new thread o threa/136345 threads Recursive read rwlocks in thread A cause deadlock with o threa/135673 threads databases/mysql50-server - MySQL query lock-ups on 7.2 o threa/133734 threads 32 bit libthr failing pthread_create() o threa/128922 threads threads hang with xorg running o threa/127225 threads bug in lib/libthr/thread/thr_init.c o threa/122923 threads 'nice' does not prevent background process from steali o threa/121336 threads lang/neko threading ok on UP, broken on SMP (FreeBSD 7 o threa/116668 threads can no longer use jdk15 with libthr on -stable SMP o threa/116181 threads /dev/io-related io access permissions are not propagat o threa/115211 threads pthread_atfork misbehaves in initial thread o threa/110636 threads [request] gdb(1): using gdb with multi thread applicat o threa/110306 threads apache 2.0 segmentation violation when calling gethost o threa/103975 threads Implicit loading/unloading of libpthread.so may crash o threa/101323 threads [patch] fork(2) in threaded programs broken. f threa/100815 threads FBSD 5.5 broke nanosleep in libc_r s threa/84483 threads problems with devel/nspr and -lc_r on 4.x o threa/80992 threads abort() sometimes not caught by gdb depending on threa o threa/79683 threads svctcp_create() fails if multiple threads call at the s threa/76694 threads fork cause hang in dup()/close() function in child (-l s threa/76690 threads fork hang in child for -lc_r s threa/69020 threads pthreads library leaks _gc_mutex s threa/48856 threads Setting SIGCHLD to SIG_IGN still leaves zombies under s threa/40671 threads pthread_cancel doesn't remove thread from condition qu s threa/34536 threads accept() blocks other threads s threa/30464 threads pthread mutex attributes -- pshared 29 problems total. From owner-freebsd-threads@FreeBSD.ORG Mon Feb 7 18:32:06 2011 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 84EE31065673; Mon, 7 Feb 2011 18:32:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: freebsd-threads@freebsd.org Date: Mon, 7 Feb 2011 13:31:42 -0500 User-Agent: KMail/1.6.2 References: <201102041409.12314.jkim@FreeBSD.org> <201102050224.23377.jkim@FreeBSD.org> <20110205095810.GW78089@deviant.kiev.zoral.com.ua> In-Reply-To: <20110205095810.GW78089@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102071331.54198.jkim@FreeBSD.org> Cc: davidxu@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: Mon, 07 Feb 2011 18:32:06 -0000 On Saturday 05 February 2011 04:58 am, Kostik Belousov wrote: > On Sat, Feb 05, 2011 at 02:24:09AM -0500, Jung-uk Kim wrote: > > On Friday 04 February 2011 04:33 pm, Kostik Belousov wrote: > > > 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 porting some software, which relies on Linux's > > > > gettid() or similar syscalls: > > > > > > > > http://www.kernel.org/doc/man-pages/online/pages/man2/gettid. > > > >2.ht ml > > > > > > > > For example: > > > > > > > > http://docs.freebsd.org/cgi/mid.cgi?201102032111.13479.jkim > > > > > > > > To solve this problem, I implemented two functions: > > > > > > > > http://people.freebsd.org/~jkim/thr_tid.diff > > > > > > > > Basically, they are AIX's pthread_getthreadid_np(3) and > > > > pthread_getunique_np(3) look-alikes: > > > > > > > > http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/a > > > >pis/ users_22.htm > > > > http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/a > > > >pis/ users_23.htm > > > > > > > > Please let me know what you think. > > > > > > Why do you need new functions available in stubs ? > > > > Oops, my bad. Fixed: > > > > http://people.freebsd.org/~jkim/thr_tid2.diff > > > > > Also, would it be better to return proper id even if threading > > > is not initialized, instead of EINVAL ? > > > > Because I want it to be fast and cause no side-effect, no. > > You can allocate static lwpid_t self_tid variable, and in case > threading is not initialized yet, and self_tid == 0, do > self_tid = thr_self(). Otherwise, if threading is initialized and > self_tid != 0, return self_tid. > > BTW, what should be the behaviour of new functions after fork() ? > Is it undefined ? Please ignore this RFC. I found (undocumented) thr_self(2) works just like pthread_getthreadid_np(3) and I don't have immediate need for pthread_getunique_np(3). Thanks! Jung-uk Kim From owner-freebsd-threads@FreeBSD.ORG Mon Feb 7 20:20:39 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 21A83106564A; Mon, 7 Feb 2011 20:20:39 +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 B08DC8FC0A; Mon, 7 Feb 2011 20:20:38 +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 p17KKYox045300 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Feb 2011 22:20:35 +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 p17KKYio091545; Mon, 7 Feb 2011 22:20:34 +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 p17KKYMn091544; Mon, 7 Feb 2011 22:20:34 +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: Mon, 7 Feb 2011 22:20:34 +0200 From: Kostik Belousov To: Jung-uk Kim Message-ID: <20110207202034.GS78089@deviant.kiev.zoral.com.ua> References: <201102041409.12314.jkim@FreeBSD.org> <201102050224.23377.jkim@FreeBSD.org> <20110205095810.GW78089@deviant.kiev.zoral.com.ua> <201102071331.54198.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yQifGgTvVVJcdOYJ" Content-Disposition: inline In-Reply-To: <201102071331.54198.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: Mon, 07 Feb 2011 20:20:39 -0000 --yQifGgTvVVJcdOYJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 07, 2011 at 01:31:42PM -0500, Jung-uk Kim wrote: > On Saturday 05 February 2011 04:58 am, Kostik Belousov wrote: > > On Sat, Feb 05, 2011 at 02:24:09AM -0500, Jung-uk Kim wrote: > > > On Friday 04 February 2011 04:33 pm, Kostik Belousov wrote: > > > > 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 porting some software, which relies on Linux's > > > > > gettid() or similar syscalls: > > > > > > > > > > http://www.kernel.org/doc/man-pages/online/pages/man2/gettid. > > > > >2.ht ml > > > > > > > > > > For example: > > > > > > > > > > http://docs.freebsd.org/cgi/mid.cgi?201102032111.13479.jkim > > > > > > > > > > To solve this problem, I implemented two functions: > > > > > > > > > > http://people.freebsd.org/~jkim/thr_tid.diff > > > > > > > > > > Basically, they are AIX's pthread_getthreadid_np(3) and > > > > > pthread_getunique_np(3) look-alikes: > > > > > > > > > > http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/a > > > > >pis/ users_22.htm > > > > > http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/a > > > > >pis/ users_23.htm > > > > > > > > > > Please let me know what you think. > > > > > > > > Why do you need new functions available in stubs ? > > > > > > Oops, my bad. Fixed: > > > > > > http://people.freebsd.org/~jkim/thr_tid2.diff > > > > > > > Also, would it be better to return proper id even if threading > > > > is not initialized, instead of EINVAL ? > > > > > > Because I want it to be fast and cause no side-effect, no. > > > > You can allocate static lwpid_t self_tid variable, and in case > > threading is not initialized yet, and self_tid =3D=3D 0, do > > self_tid =3D thr_self(). Otherwise, if threading is initialized and > > self_tid !=3D 0, return self_tid. > > > > BTW, what should be the behaviour of new functions after fork() ? > > Is it undefined ? >=20 > Please ignore this RFC. I found (undocumented) thr_self(2) works just=20 > like pthread_getthreadid_np(3) and I don't have immediate need for=20 > pthread_getunique_np(3). I think that making thr_* private libthr syscalls part of the public namespace was unfortunate. If you need the functionality of pthread_getthreadid_np(3), then please introduce it, as discussed above, and use. We already have somewhat sad experience with kse, when static binaries where broken. Using thr_self() directly in such important application as jdk/jre might cause similar problem in future (I hope not). Also, you said that pthread_getthreadid_np(3) was taken from AIX, am I remember right ? This is additional argument for use it instead of single-implementation interface. --yQifGgTvVVJcdOYJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk1QVBIACgkQC3+MBN1Mb4hN9gCfXtpo7h85Ab/kZsWjAGeTVP4w h5IAoKn5wRLjHLt7oPFthFPtOe0ZH/13 =i677 -----END PGP SIGNATURE----- --yQifGgTvVVJcdOYJ-- From owner-freebsd-threads@FreeBSD.ORG Mon Feb 7 20:58:15 2011 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 323BB1065697; Mon, 7 Feb 2011 20:58:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: freebsd-threads@freebsd.org Date: Mon, 7 Feb 2011 15:58:01 -0500 User-Agent: KMail/1.6.2 References: <201102041409.12314.jkim@FreeBSD.org> <201102071331.54198.jkim@FreeBSD.org> <20110207202034.GS78089@deviant.kiev.zoral.com.ua> In-Reply-To: <20110207202034.GS78089@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102071558.03573.jkim@FreeBSD.org> Cc: davidxu@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: Mon, 07 Feb 2011 20:58:15 -0000 On Monday 07 February 2011 03:20 pm, Kostik Belousov wrote: > On Mon, Feb 07, 2011 at 01:31:42PM -0500, Jung-uk Kim wrote: > > On Saturday 05 February 2011 04:58 am, Kostik Belousov wrote: > > > On Sat, Feb 05, 2011 at 02:24:09AM -0500, Jung-uk Kim wrote: > > > > On Friday 04 February 2011 04:33 pm, Kostik Belousov wrote: > > > > > 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 porting some software, which relies on Linux's > > > > > > gettid() or similar syscalls: > > > > > > > > > > > > http://www.kernel.org/doc/man-pages/online/pages/man2/get > > > > > >tid. 2.ht ml > > > > > > > > > > > > For example: > > > > > > > > > > > > http://docs.freebsd.org/cgi/mid.cgi?201102032111.13479.jk > > > > > >im > > > > > > > > > > > > To solve this problem, I implemented two functions: > > > > > > > > > > > > http://people.freebsd.org/~jkim/thr_tid.diff > > > > > > > > > > > > Basically, they are AIX's pthread_getthreadid_np(3) and > > > > > > pthread_getunique_np(3) look-alikes: > > > > > > > > > > > > http://publib.boulder.ibm.com/infocenter/iseries/v5r4/top > > > > > >ic/a pis/ users_22.htm > > > > > > http://publib.boulder.ibm.com/infocenter/iseries/v5r4/top > > > > > >ic/a pis/ users_23.htm > > > > > > > > > > > > Please let me know what you think. > > > > > > > > > > Why do you need new functions available in stubs ? > > > > > > > > Oops, my bad. Fixed: > > > > > > > > http://people.freebsd.org/~jkim/thr_tid2.diff > > > > > > > > > Also, would it be better to return proper id even if > > > > > threading is not initialized, instead of EINVAL ? > > > > > > > > Because I want it to be fast and cause no side-effect, no. > > > > > > You can allocate static lwpid_t self_tid variable, and in case > > > threading is not initialized yet, and self_tid == 0, do > > > self_tid = thr_self(). Otherwise, if threading is initialized > > > and self_tid != 0, return self_tid. > > > > > > BTW, what should be the behaviour of new functions after fork() > > > ? Is it undefined ? > > > > Please ignore this RFC. I found (undocumented) thr_self(2) works > > just like pthread_getthreadid_np(3) and I don't have immediate > > need for pthread_getunique_np(3). > > I think that making thr_* private libthr syscalls part of the > public namespace was unfortunate. If you need the functionality of > pthread_getthreadid_np(3), then please introduce it, as discussed > above, and use. > > We already have somewhat sad experience with kse, when static > binaries where broken. Using thr_self() directly in such important > application as jdk/jre might cause similar problem in future (I > hope not). > > Also, you said that pthread_getthreadid_np(3) was taken from AIX, > am I remember right ? This is additional argument for use it > instead of single-implementation interface. Agreed. http://people.freebsd.org/~jkim/thr_tid3.diff Please note pthread_getunique_np() is removed. Thanks, Jung-uk Kim From owner-freebsd-threads@FreeBSD.ORG Mon Feb 7 21:02:23 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 7C657106564A; Mon, 7 Feb 2011 21:02:23 +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 187398FC18; Mon, 7 Feb 2011 21:02:22 +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 p17L2JE3050334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Feb 2011 23:02:19 +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 p17L2Jow028100; Mon, 7 Feb 2011 23:02:19 +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 p17L2Jj5028099; Mon, 7 Feb 2011 23:02:19 +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: Mon, 7 Feb 2011 23:02:19 +0200 From: Kostik Belousov To: Jung-uk Kim Message-ID: <20110207210219.GU78089@deviant.kiev.zoral.com.ua> References: <201102041409.12314.jkim@FreeBSD.org> <201102071331.54198.jkim@FreeBSD.org> <20110207202034.GS78089@deviant.kiev.zoral.com.ua> <201102071558.03573.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fh5LqGQwq8YwuKb/" Content-Disposition: inline In-Reply-To: <201102071558.03573.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: Mon, 07 Feb 2011 21:02:23 -0000 --Fh5LqGQwq8YwuKb/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 07, 2011 at 03:58:01PM -0500, Jung-uk Kim wrote: > On Monday 07 February 2011 03:20 pm, Kostik Belousov wrote: > > On Mon, Feb 07, 2011 at 01:31:42PM -0500, Jung-uk Kim wrote: > > > On Saturday 05 February 2011 04:58 am, Kostik Belousov wrote: > > > > On Sat, Feb 05, 2011 at 02:24:09AM -0500, Jung-uk Kim wrote: > > > > > On Friday 04 February 2011 04:33 pm, Kostik Belousov wrote: > > > > > > 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 porting some software, which relies on Linux's > > > > > > > gettid() or similar syscalls: > > > > > > > > > > > > > > http://www.kernel.org/doc/man-pages/online/pages/man2/get > > > > > > >tid. 2.ht ml > > > > > > > > > > > > > > For example: > > > > > > > > > > > > > > http://docs.freebsd.org/cgi/mid.cgi?201102032111.13479.jk > > > > > > >im > > > > > > > > > > > > > > To solve this problem, I implemented two functions: > > > > > > > > > > > > > > http://people.freebsd.org/~jkim/thr_tid.diff > > > > > > > > > > > > > > Basically, they are AIX's pthread_getthreadid_np(3) and > > > > > > > pthread_getunique_np(3) look-alikes: > > > > > > > > > > > > > > http://publib.boulder.ibm.com/infocenter/iseries/v5r4/top > > > > > > >ic/a pis/ users_22.htm > > > > > > > http://publib.boulder.ibm.com/infocenter/iseries/v5r4/top > > > > > > >ic/a pis/ users_23.htm > > > > > > > > > > > > > > Please let me know what you think. > > > > > > > > > > > > Why do you need new functions available in stubs ? > > > > > > > > > > Oops, my bad. Fixed: > > > > > > > > > > http://people.freebsd.org/~jkim/thr_tid2.diff > > > > > > > > > > > Also, would it be better to return proper id even if > > > > > > threading is not initialized, instead of EINVAL ? > > > > > > > > > > Because I want it to be fast and cause no side-effect, no. > > > > > > > > You can allocate static lwpid_t self_tid variable, and in case > > > > threading is not initialized yet, and self_tid =3D=3D 0, do > > > > self_tid =3D thr_self(). Otherwise, if threading is initialized > > > > and self_tid !=3D 0, return self_tid. > > > > > > > > BTW, what should be the behaviour of new functions after fork() > > > > ? Is it undefined ? > > > > > > Please ignore this RFC. I found (undocumented) thr_self(2) works > > > just like pthread_getthreadid_np(3) and I don't have immediate > > > need for pthread_getunique_np(3). > > > > I think that making thr_* private libthr syscalls part of the > > public namespace was unfortunate. If you need the functionality of > > pthread_getthreadid_np(3), then please introduce it, as discussed > > above, and use. > > > > We already have somewhat sad experience with kse, when static > > binaries where broken. Using thr_self() directly in such important > > application as jdk/jre might cause similar problem in future (I > > hope not). > > > > Also, you said that pthread_getthreadid_np(3) was taken from AIX, > > am I remember right ? This is additional argument for use it > > instead of single-implementation interface. >=20 > Agreed. >=20 > http://people.freebsd.org/~jkim/thr_tid3.diff >=20 > Please note pthread_getunique_np() is removed. Looks good. --Fh5LqGQwq8YwuKb/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk1QXdsACgkQC3+MBN1Mb4iLdgCgr0qWAXeUWxXdqNmxXRwKZpmF iG0AoOn9/C59wqbM4fqgEQqghn3Eexay =xjL9 -----END PGP SIGNATURE----- --Fh5LqGQwq8YwuKb/--