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

Re: twothreads.c not working correctly on ARM AEB1


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

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