This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: twothreads.c not working correctly on ARM AEB1
- To: javelina <javelina at home dot com>
- Subject: Re: [ECOS] twothreads.c not working correctly on ARM AEB1
- From: Jonathan Larmour <jlarmour at redhat dot co dot uk>
- Date: Sun, 25 Jun 2000 16:15:07 +0100
- CC: ecos-discuss at sourceware dot cygnus dot com
- Organization: Red Hat UK Ltd.
- References: <3945AF98.2C962EAD@home.com> <39464D44.A31E032@redhat.co.uk> <3949A6A1.E2B8765C@home.com> <3949A99E.155337F7@redhat.co.uk> <39554E7A.D19FF193@home.com>
javelina wrote:
[snip]
>
> When I turned on asserts with no tracing I get no additional output again:
>
> (gdb) continue
> Continuing.
> Entering twothreads' cyg_user_start() function
> Beginning execution; thread data is 0
> Beginning execution; thread data is 1
> Thread 0: and now a delay of 1104334939 clock ticks
> Thread 1: and now a delay of 1149184530 clock ticks
[snip]
Sorry, I should have said before: the reason that there's no output is that
that number of clock ticks is *far* too large. It's meant to be a number
between 200 and 250.
Let's try a different approach:
Change the following two lines of code in twothreads.c from
for (;;) {
delay = 200 + (rand() % 50);
to:
for (;;) {
int r, d;
r=rand();
d=rand() % 50;
delay = 200 + d;
diag_printf("r=%d, d=%d, delay=%d\n", r, d, delay );
Another thing to do is to try compiling twothreads.c both with and without
optimization (i.e. with -O2 or without -O2) and see if there's any
difference.
HTH,
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault