From owner-freebsd-current Wed Oct 30 15:40:25 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9332F37B401 for ; Wed, 30 Oct 2002 15:40:23 -0800 (PST) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99AEE43E4A for ; Wed, 30 Oct 2002 15:40:22 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from mailgate.nlsystems.com ([62.49.251.130] helo=herring.nlsystems.com) by anchor-post-32.mail.demon.net with esmtp (Exim 3.35 #1) id 1872Rh-000D6D-0W; Wed, 30 Oct 2002 23:40:21 +0000 Received: from herring (herring [10.0.0.2]) by herring.nlsystems.com (8.12.6/8.12.4) with ESMTP id g9UNeKj0032716; Wed, 30 Oct 2002 23:40:20 GMT (envelope-from dfr@nlsystems.com) Date: Wed, 30 Oct 2002 23:40:20 +0000 (GMT) From: Doug Rabson To: Terry Lambert Cc: Daniel Eischen , Subject: Re: [PATCH: libc]Re: gnome on current In-Reply-To: <3DC068EE.D04E207C@mindspring.com> Message-ID: <20021030233833.C22480-100000@herring.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 30 Oct 2002, Terry Lambert wrote: > Doug Rabson wrote: > > > You need to link the library against libc_r.so instead of libXThrStub.so. > > > > Probably not. Doing that breaks the existing 'feature' of being able to > > use X11 in entirely non-threaded programs. I'm not sure whether that is > > acceptable. It also stops programs from being able to select between > > several thread implementations, of which -current has two. > > > > I think the only sensible solution to this problem is for libraries which > > provide an actual pthreads implementation (rather than a set of stubs) to > > define strong symbols. Wierd debugging wrappers can still be achieved via > > some dlopen/dlsym hackery. > > OK... I guess I don't understand the problem. > > If you are not compiling threaded programs for use with X, and > X itself is not threaded, then why the heck was the threads stuff > there in the first place? > > If X itself uses threads, then you need to use threads: there's > no option in the matter. > > If libX11.so does not reference, the threads symbols, who cares? > > If libX11.so *does* reference the threads symbols, then they need > to be there. > > You can't have a library that's sort of threaded and sort of not > threaded: pick one. Yes you can - libX11 is *thread safe* but doesn't create threads. When a real pthreads implementation is present, libX11 uses its implementation of mutex, cond etc. to ensure its own safety. If the application doesn't link to a real pthreads implementation, it uses no-op stubs instead. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message