threads question

Michael C. Shultz ringworm01 at gmail.com
Tue Mar 15 12:28:21 PST 2005


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


More information about the freebsd-hackers mailing list