[ECOS] Re: SMPising ecos tests : bin_sem3

Nick Garnett nickg@ecoscentric.com
Thu Oct 14 15:39:00 GMT 2004


sandeep <shimple0@yahoo.com> writes:

> 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.

Those tests that are attempting to test the operation of the scheduler
and the synchronization objects do so by checking that threads run in
the expected sequence. Obviously these will not work on an SMP target,
and cannot be easily fixed to do so. The usual approach is to disable
these tests for SMP configurations. It looks like bin_sem3 should join
them.



-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


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



More information about the Ecos-discuss mailing list