From owner-freebsd-threads@FreeBSD.ORG Thu May 8 06:56:48 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 B253237B401; Thu, 8 May 2003 06:56:48 -0700 (PDT) Received: from h132-197-179-27.gte.com (h132-197-179-27.gte.com [132.197.179.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id A028F43F3F; Thu, 8 May 2003 06:56:47 -0700 (PDT) (envelope-from ak03@gte.com) Received: from kanpc.gte.com (ak03@localhost [127.0.0.1]) h48Dui3D027288; Thu, 8 May 2003 09:56:44 -0400 (EDT) (envelope-from ak03@kanpc.gte.com) Received: (from ak03@localhost) by kanpc.gte.com (8.12.9/8.12.9/Submit) id h48Duiti027287; Thu, 8 May 2003 09:56:44 -0400 (EDT) Date: Thu, 8 May 2003 09:56:44 -0400 From: Alexander Kabaev To: "David Xu" Message-Id: <20030508095644.06571486.ak03@gte.com> In-Reply-To: <005d01c314ff$32b737b0$f001a8c0@davidw2k> References: <005d01c314ff$32b737b0$f001a8c0@davidw2k> Organization: Verizon Data Services X-Mailer: Sylpheed version 0.8.11claws141 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2003 13:56:49 -0000 On Thu, 8 May 2003 09:14:37 +0800 "David Xu" wrote: > > ----- Original Message ----- > From: "Daniel Eischen" > To: "David Xu" > Cc: > Sent: Thursday, May 08, 2003 9:05 AM > Subject: Re: libpthread_init > > > I know. I brought this up years ago, but didn't really > > know how to fix it. > > > > > 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, > > > > I know, I know :-) You're preaching to the choir! (I agree) > > > > > 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. > > > > 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. > > > > This is what I want to see, neat code. :-) > I will try to see if I can work out a patch. So what is wrong with __attribute__((constructor)) again? -- Alexander Kabaev