This is the mail archive of the ecos-devel@sourceware.org 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]

thread2 test gets deadlocked... Is it possible or am I missing some config option?


Hi there,

Testing my hal for Cortex-R4, I'm getting a funny behaviour for test
 kernel/.../thread2. It seems that when two threads have the same
 priority, there is no timeslicing working (interestingly, the
 timeslice tests also get deadlocked).

The problem seems to appear because thread#2 preempts thread #1,
(thread #1 seems to do more API calls than thread #2, but reducing the
unnecessary ones does not solve the problem), so thread #2 gets
waiting for thread #1 to increase "q", and thread #1 never gets
scheduled to realize that "q" has moved to 101, so it can move it to
102...

I've added lots of traces (see attached modified thread2.cxx, and the
trace output below).

Is this test expected to succeed without timeslicing?
Is it possible that the checks that thread#1 does at that critical
point might tip off the things to the wrong side?
Or is it that I might have some wrong configuration option set or unset?

If none of the above... Any idea on what could be wrong?

Regards.

These are the extra output that tries to show what is wrong:

INFO:<Main changing priority for thread #0 to 5.>
INFO:<Main changing priority for thread #1 to 6.>
INFO:<Main changing priority for thread #2 to 7.>
INFO:<Changing Priorities in main done.>
INFO:<Thread #0 Has q 0 => 1.>
INFO:<Thread #0 waiting on s0...>
INFO:<Thread #1 Has q 1 => 2.>
INFO:<Thread #1 waiting on s1...>
INFO:<Thread #2 Has q 2 => 3.>
INFO:<Thread #2 Posts s0.>
INFO:<Thread #0 waiting on s0 done.>
INFO:<Thread #0 Has q 3 => 4.>
INFO:<Thread #0 Posts s1.>
INFO:<Thread #0 Has q 4 => 5.>
INFO:<Thread #0 waiting on s0 (1/2)...>
INFO:<Thread #1 waiting on s1 done.>
INFO:<Thread #1 Has q 5 => 6.>
INFO:<Thread #1 changing priority for thread #0 to 9.>
INFO:<Thread #1 Posts s0.>
INFO:<Thread #1 Has q 6 => 7.>
INFO:<Thread #1 changing priority for thread #2 to 3.>
INFO:<Thread #2 Has q 7 => 8.>
INFO:<Thread #2 waiting on s2...>
INFO:<Thread #1 Has q 8 => 9.>
INFO:<Thread #1 Posts s2.>
INFO:<Thread #2 waiting on s2 done.>
INFO:<Thread #2 Has q 9 => 10.>
INFO:<Thread #2 changing priority for thread #1 to 6.>
INFO:<Thread #2 Has q 10 => 11.>
INFO:<Thread #2 changing its priority to 2.>
INFO:<Thread #2 Has q 11 => 12.>
INFO:<Thread #2 changing its priority to 7.>
INFO:<Thread #1 Has q 12 => 13.>
INFO:<Thread #1 Has q => 100.>
INFO:<Thread #1 changing priority for thread #2 to 6.>
INFO:<Thread #1 waiting for 'INFO:<Thread #2 Has q 100 => 101.>
INFO:<Thread #2 waiting for 'q' to be != 101...>

Attachment: thread2.cxx
Description: Binary data


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