From owner-freebsd-threads@FreeBSD.ORG Thu May 8 07:35:37 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CDF0937B404; Thu, 8 May 2003 07:35:37 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 102EB43FA3; Thu, 8 May 2003 07:35:35 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from tiger (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with SMTP id h48EZSUp059952; Thu, 8 May 2003 07:35:31 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <002b01c3156f$86209020$0701a8c0@tiger> From: "David Xu" To: "Alexander Kabaev" References: <005d01c314ff$32b737b0$f001a8c0@davidw2k> <20030508095644.06571486.ak03@gte.com> Date: Thu, 8 May 2003 22:38:37 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 cc: Daniel Eischen cc: freebsd-threads@freebsd.org Subject: Re: libpthread_init X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: David Xu List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2003 14:35:38 -0000 ----- Original Message -----=20 From: "Alexander Kabaev" To: "David Xu" Cc: "Daniel Eischen" ; = Sent: Thursday, May 08, 2003 9:56 PM Subject: Re: libpthread_init > On Thu, 8 May 2003 09:14:37 +0800 > "David Xu" wrote: >=20 > >=20 > > ----- Original Message -----=20 > > From: "Daniel Eischen" > > To: "David Xu" > > Cc: > > Sent: Thursday, May 08, 2003 9:05 AM > > Subject: Re: libpthread_init > >=20 > > > I know. I brought this up years ago, but didn't really > > > know how to fix it. > > >=20 > > > > It is error-prone mode, while mono-thread has a perfect > > > > initializing step, why should threaded app have a bad = initializing > > > > step, and we must put : "if (!__isthreaded) then do something" > > > > everywhere in thread library, > > >=20 > > > I know, I know :-) You're preaching to the choir! (I agree) > > >=20 > > > > I have already found that a simple "write(1, "hello", 5)" would > > > > cause SEGSIGV when it is linked with static pthread library. > > > > FreeBSD now has two mode apps, mono-threaded and mutli-threaded, = > > > > I think both should have a good initializing code, both are > > > > important, libc should be refined to reflect the fact. > > >=20 > > > Yes. Have you tried it to see if it works? The other thread > > > libraries would also need to be updated. We should use a common > > > symbol like __thread_init() or __libc_thread_init() so they can > > > all override the same symbol. > > >=20 > >=20 > > This is what I want to see, neat code. :-) > > I will try to see if I can work out a patch. >=20 > So what is wrong with __attribute__((constructor)) again? >=20 It does not work for archive version of thread library. > --=20 > Alexander Kabaev > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to = "freebsd-threads-unsubscribe@freebsd.org" >=20