Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Jun 2004 00:40:46 -0700
From:      Sean McNeil <sean@mcneil.com>
To:        Daniel Eischen <eischen@vigrid.com>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: weak implementation of threads has problems - kse fix attached
Message-ID:  <1086680446.1060.3.camel@server.mcneil.com>
In-Reply-To: <Pine.GSO.4.10.10406080126400.27228-100000@pcnet5.pcnet.com>
References:  <Pine.GSO.4.10.10406080126400.27228-100000@pcnet5.pcnet.com>

index | next in thread | previous in thread | raw e-mail

On Mon, 2004-06-07 at 22:34, Daniel Eischen wrote:
> On Tue, 8 Jun 2004, John Birrell wrote:
> 
> > [ cross-post lists cut back, ports added 8-) ]
> > 
> > On Mon, Jun 07, 2004 at 11:48:45PM -0500, Dan Nelson wrote:
> > > A good addition to bsd.port.mk, right next to the "possible network
> > > server" etc checks, might be to run ldd on all installed shared
> > > libraries and print a warning if any threads libraries show up.  There
> > > are a huge number of ports that install shlibs linked to libpthreads.
> > 
> > Good idea.
> 
> Just picking a message at random to reply to...
> 
> In case anyone wonders why we don't use strong references, I chose to
> mimic what Solaris does:
> 
>   bash-2.05$ nm /lib/libpthread.so.1 | grep pthread_mutex_lock
>   0000000000003c80 T _pthread_mutex_lock
>   0000000000003c80 W pthread_mutex_lock
> 
>   bash-2.05$ nm /lib/libc.so.1 | grep pthread_mutex_lock
>   0000000000096c38 W _pthread_mutex_lock
>   0000000000096c38 W pthread_mutex_lock
> 
> It is also easy to provide your own version of pthread_foo() without
> having any strong references override it.

OK, that is what I was wondering.  In that case, you have failed to
mimic Solaris:

[sean@wrsparc sean]$ uname -a
SunOS wrsparc.mcneil.com 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-5_10

[sean@wrsparc sean]$ nm /lib/libpthread.so.1 | grep select
[201]   |     21328|       8|FUNC |GLOB |0    |8      |select

[sean@wrsparc sean]$ nm /lib/libc.so.1 | grep select
[213]   |    320732|    1420|FUNC |LOCL |0    |12     |_libc_select
[4534]  |    320732|    1420|FUNC |GLOB |0    |12     |_select
[3556]  |    320732|    1420|FUNC |WEAK |0    |12     |select
[1385]  |         0|       0|FILE |LOCL |0    |ABS    |select.c
[4404]  |    322152|    1920|FUNC |GLOB |0    |12     |select_large_fdset
[1387]  |         0|       0|FILE |LOCL |0    |ABS    |select_large_fdset.c

Same thing with open or any of the other libc functions.

That is why Solaris works correctly and FreeBSD does not.



help

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