|
From: Tom H. <th...@cy...> - 2005-01-17 15:02:06
|
In message <1105952911.31917.57.camel@localhost>
Jeremy Fitzhardinge <je...@go...> wrote:
> On Mon, 2005-01-17 at 08:44 +0000, Tom Hughes wrote:
>
>> >> none/tests/yield (stdout)
>> >
>> > Can you think of any useful assertion this test could be making?
>> > Perhaps we should just kill it.
>>
>> Well what is it trying to test? Presumably the idea was to test that
>> the "rep; nop" sequence caused a yield properly.
>>
>> Perhaps it is sufficient to test that "rep; nop" makes progress but
>> less progress that spinning?
>
> Yeah, I guess that's all we can say.
Even that isn't good enough... I'm finding the yield test
sometimes hangs and I've just worked out why - sometimes the
rep_nop thread makes no progress at all during the sleep.
Specifically, that thread never reacts to the broadcast before
the sleep is up, so by the time it leaves the cond_wait and
tests the alive flag the flag has been set back to zero and it
goes round the loop again.
I could fix that by using a separate flag to kill the thread
instead of reusing the one that woke it up, but then the test
would fail because the rep_nop count would be zero.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|