From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 15 20:28:20 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC34B16A4CE for ; Tue, 15 Mar 2005 20:28:20 +0000 (GMT) Received: from vms048pub.verizon.net (vms048pub.verizon.net [206.46.252.48]) by mx1.FreeBSD.org (Postfix) with ESMTP id B68D743D49 for ; Tue, 15 Mar 2005 20:28:20 +0000 (GMT) (envelope-from ringworm01@gmail.com) Received: from ringworm.mechee.com ([4.27.46.32])0.04 <0IDE00MW1U77JCE0@vms048.mailsrvcs.net> for freebsd-hackers@freebsd.org; Tue, 15 Mar 2005 14:28:20 -0600 (CST) Received: by ringworm.mechee.com (Postfix, from userid 1001) id 14C3C2CE75B; Tue, 15 Mar 2005 12:28:18 -0800 (PST) Date: Tue, 15 Mar 2005 12:28:16 -0800 From: "Michael C. Shultz" In-reply-to: To: Zera William Holladay Message-id: <200503151228.17719.ringworm01@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit Content-disposition: inline References: <200503151135.53269.ringworm01@gmail.com> User-Agent: KMail/1.7.2 cc: freebsd-hackers@freebsd.org Subject: Re: threads question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2005 20:28:21 -0000 On Tuesday 15 March 2005 12:02 pm, you wrote: > On Tue, 15 Mar 2005, Michael C. Shultz wrote: > [cut] > > > The answer is probably something like what you just said, scope > > being lost when making the call to a shared library. Why is it ok > > going to a static library but not a shared though? > > There is probably a race condition, so your code will work *some* of > the time unless you prevent the race condition. I don't have an > answer to your question, but I don't think it is a valid question. > The scope of "*priority" can remain valid or invalid for random > reasons and thus may work some of the time, but the only way to > guarantee that it works all the time is to eliminate the race > condition by making sure that *property is valid though the life of > the thread. > > -Zera Hmmm, should I'll try making "property" global then passing a copy of it to each thread? I think that will guarantee it stays valid. -Mike