Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Mar 2005 12:28:16 -0800
From:      "Michael C. Shultz" <ringworm01@gmail.com>
To:        Zera William Holladay <zholla1@uic.edu>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: threads question
Message-ID:  <200503151228.17719.ringworm01@gmail.com>
In-Reply-To: <Pine.GSO.4.58.0503151349080.27785@icarus.cc.uic.edu>
References:  <Pine.GSO.4.43.0503151312090.12075-100000@sea.ntplx.net> <200503151135.53269.ringworm01@gmail.com> <Pine.GSO.4.58.0503151349080.27785@icarus.cc.uic.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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