Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 May 2003 09:56:44 -0400
From:      Alexander Kabaev <ak03@gte.com>
To:        "David Xu" <davidxu@freebsd.org>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: libpthread_init
Message-ID:  <20030508095644.06571486.ak03@gte.com>
In-Reply-To: <005d01c314ff$32b737b0$f001a8c0@davidw2k>
References:  <Pine.GSO.4.10.10305072058110.2395-100000@pcnet1.pcnet.com> <005d01c314ff$32b737b0$f001a8c0@davidw2k>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 8 May 2003 09:14:37 +0800
"David Xu" <davidxu@freebsd.org> wrote:

> 
> ----- Original Message ----- 
> From: "Daniel Eischen" <eischen@pcnet1.pcnet.com>
> To: "David Xu" <davidxu@viatech.com.cn>
> Cc: <freebsd-threads@freebsd.org>
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030508095644.06571486.ak03>