This is the mail archive of the ecos-discuss@sources.redhat.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]
Other format: [Raw text]

Re: Thread sample error


Hi,
I have installed the instrument for thread and test with the standard sample
instrument-test.c
all is ok, same as documentation.
When I add an second  delay for thread same as this :

  cyg_instrument_enable(CYG_INSTRUMENT_CLASS_CLOCK, 0);
  cyg_instrument_enable(CYG_INSTRUMENT_CLASS_THREAD, 0);
  cyg_instrument_enable(CYG_INSTRUMENT_CLASS_ALARM, 0);

  cyg_thread_delay(2);
  cyg_thread_delay(2);    /* the second delay that break the kernel */

  cyg_instrument_disable(CYG_INSTRUMENT_CLASS_CLOCK, 0);
  cyg_instrument_disable(CYG_INSTRUMENT_CLASS_THREAD, 0);
  cyg_instrument_disable(CYG_INSTRUMENT_CLASS_ALARM, 0);

after the crash, i reset and read the memory buffer, the sequence of the
trhead read is :

record 0    thread 2    delay
record 1    thread 2    sleep
record 2    thread 2    switch
record 3    thread 1    enter
record 4    thread 1    alarm
record 5    thread 1    wake
record 6    thread 1    switch
record 7    thread 2    delay
record 8    thread 2    sleep
record 9    thread 2    switch
record 10  thread 1    alarm
record 11  thread 1    wake
record 12  thread 1    switch
record 13  thread 1    switch

are this correct ?

many thanks for your help.

balet charles-henri

----- Original Message -----
From: "Jonathan Larmour" <jlarmour@redhat.com>
To: "Charles-Henri Balet" <charles-henri@bluewin.ch>
Cc: <ecos-discuss@sources.redhat.com>
Sent: Friday, April 12, 2002 8:24 PM
Subject: Re: [ECOS] Thread sample error


> Charles-Henri Balet wrote:
> >
> > Hi,
> >
> > I have porting the pid platform on an oki board, it's work fine for
standard
> > and redboot, i'm happy.
> > I want to test the thread sample program and the result is this on the
> > serial port :
> >
> > 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 239 clock ticks
> > Thread 1: and now a delay of 230 clock ticks
> >
> > and ... no more
> >
> > the cyg_thread_delay(x) work only one time by thread, with only the
thread
> > A, I have this result :
> >
> > Entering twothreads' cyg_user_start() function
> > Beginning execution; thread data is 0
> > Thread 0: and now a delay of 239 clock ticks
> >
> > the interrupt timer for RTC clock work fine, my problem is only with the
> > cyg_thread_delay function,
> > the first call work fine but I cannot call this function any more, the
> > second call don't return...
> >
> > any has an solution ?
>
> I've heard several people reporting this, but have never seen it myself.
If
> you break and do "info threads" are the threads listed but asleep? You
> could enable kernel instrumentation, and decode the instrumentation buffer
> to determine what the kernel has been up to. You could even try setting a
> breakpoint in the kernel at Cyg_Scheduler::unlock_inner which should catch
> all thread switches.
>
> Jifl
> --
> Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
> Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
>



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


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