This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SMPising ecos tests : bin_sem3


entry0 (...)
{
.....
    s0.post();
    CHECK( 3 == q++ );
    CHECK( s0.posted() );
A0 ->    s1.post();
B0 ->    CHECK( ! s2.posted() );  <---- fails here in SMP configuration
...
}

entry1 (...)
{
......
A1 ->    s1.wait();
    CHECK( 4 == q++ );
    CHECK( s0.posted() );
#ifndef CYGFUN_KERNEL_THREADS_TIMER
    CHECK( s0.trywait() );
#else // !CYGFUN_KERNEL_THREADS_TIMER
    CHECK( s0.wait(10) );
#endif // !CYGFUN_KERNEL_THREADS_TIMER
    CHECK( ! s0.posted() );
B1 ->    s2.post();
......
}

since both threads can run on different processors simultaneously and different interrupts are enabled on different processors (say entry0 is running on processor where timer interrupt is enabled) - there are race conditions pertaining to CHECK in SMP configuration. though path A0-B0 is seemingly very small as compared to A1-B1 .

earlier also similar problems have been reported with same and similar tests on devel and patches lists.
though with changes to scheduler eCos has been SMP-ised, but many tests won't work on SMP. i guess, a serious thought needs to be given about scruitinising the existing and newly-planned tests for SMP configuration.


regards
sandeep

_______________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail


-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]