This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: SMPising ecos tests : bin_sem3
- From: sandeep <shimple0 at yahoo dot com>
- To: sandeep <shimple0 at yahoo dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org, jiri at gaisler dot com
- Date: Thu, 14 Oct 2004 20:04:37 +0530
- Subject: [ECOS] Re: SMPising ecos tests : bin_sem3
- References: <20040923162212.58547.qmail@web52709.mail.yahoo.com>
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