From owner-freebsd-threads@FreeBSD.ORG Sun Mar 28 23:43:51 2004 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 7E01316A4CE for ; Sun, 28 Mar 2004 23:43:51 -0800 (PST) Received: from pimout3-ext.prodigy.net (pimout3-ext.prodigy.net [207.115.63.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id 02A6E43D49 for ; Sun, 28 Mar 2004 23:43:51 -0800 (PST) (envelope-from julian@elischer.org) Received: from elischer.org (adsl-216-100-132-94.dsl.snfc21.pacbell.net [216.100.132.94])i2T7hmGa018434; Mon, 29 Mar 2004 02:43:49 -0500 Message-ID: <4067D344.8030403@elischer.org> Date: Sun, 28 Mar 2004 23:41:56 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4b) Gecko/20030524 X-Accept-Language: en, hu MIME-Version: 1.0 To: Niall Douglas References: <4067688B.19545.1A50C1@localhost> <4067CC9B.8940.1A12F51@localhost> In-Reply-To: <4067CC9B.8940.1A12F51@localhost> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: GDB 6.0 and FreeBSD threads 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: Mon, 29 Mar 2004 07:43:51 -0000 Niall Douglas wrote: > -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > > On 28 Mar 2004 at 21:13, Julian Elischer wrote: > > > > You must remember I've never been near FreeBSD before. When the man page says > POSIX threads are supported, I assumed that meant a full implementation in > libc_r as the man page specifies. You can see why I might think that, > especially as libc_r doesn't complain when my code sets PTHREAD_SCOPE_SYSTEM > which libc_r should return an error on by rights. On this topic, There are 3 separate compatible threads libraries Libc_r is only SCOPE_PROCESS, libpthreads implements SCOPE_PROCESS and SCOPE_SYSTEM, and libthr is only SCOPE_SYSTEM. Do you run ALL threads as scope system, or only some? We don't recommend COPE_SYSTEM unless it's really needed (for example to make some threads run at higher/lower priorities) as they are less efficient. Benchmark your app with both types. (I think Linux is only SCOPE_SYSTEM). > > BTW on my FreeBSD v5.2.1 the library is called libkse, not libpthread which > doesn't exist. > That's the problem with the fact that this field moving so quickly. You should probably upgrade to -current so that you can debug these threads. and get reeady for yur app to run on 5.3. > >>> You guys could seriously improve the documentation inside the man pages. >>> Please! Just a two line paragraph would have saved me more than a day of >>> work. >> >> we can't guess what question every developer is going to ask.. But possibly >> the following paragraph in "man pthread" might be made a bit clearer... > > > Typing man pthread on my FreeBSD v5.2.1 does not show the text you quoted. > Instead it says it's in libc_r and mentions nothing else. Hmm maybe it was added since.. oh well. At least you get to see that we are trying to cover the blank spots. > > >>> After linking to libkse and finding it really doesn't like coexisting >>> with libc_r, I discovered the libmap.conf trick and it works now. >>> Unfortunately I'm back to square one in that no gdb supports kse threads. >>> This is a major problem as my code is heavily multithreaded. >> >> why is libc_r beinbg linked into your application? you need to select ONE >> of the libraries and link with that.. > > > It's not me. I link against libGL and /it/ is linked against libc_r. warning: if you use the nvidia GL libraries you can not yet use libpthread. > > >> The threads support package is at: >> >> http://people.freebsd.org/~davidxu/kse/thread_db/ however, realise that >> this is PRE_ALPHA. you are "on your own" except for direct corespondence >> with david. > > > Wicked. I had searched google for that in vain so thank you. Do I post bug > reports here or to David directly? directly to david.. it's still in prerelease. Also, you MUST be running TODAY'S -current so you'll need to upgrade. Sorry but it's an area of active development. -- +------------------------------------+ ______ _ __ | __--_|\ Julian Elischer | \ U \/ / hard at work in | / \ julian@elischer.org +------>x USA \ a very strange | ( OZ ) \___ ___ | country ! +- X_.---._/ presently in San Francisco \_/ \\ v