public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Thread sample error
@ 2002-04-10 15:23 Charles-Henri Balet
  2002-04-12 11:24 ` Jonathan Larmour
  0 siblings, 1 reply; 3+ messages in thread
From: Charles-Henri Balet @ 2002-04-10 15:23 UTC (permalink / raw)
  To: ecos-discuss

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 ?

many thanks

balet charles-henri



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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] Thread sample error
  2002-04-10 15:23 [ECOS] Thread sample error Charles-Henri Balet
@ 2002-04-12 11:24 ` Jonathan Larmour
  2002-04-13 11:06   ` Charles-Henri Balet
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Larmour @ 2002-04-12 11:24 UTC (permalink / raw)
  To: Charles-Henri Balet; +Cc: ecos-discuss

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] Thread sample error
  2002-04-12 11:24 ` Jonathan Larmour
@ 2002-04-13 11:06   ` Charles-Henri Balet
  0 siblings, 0 replies; 3+ messages in thread
From: Charles-Henri Balet @ 2002-04-13 11:06 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: eCos

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-04-13 18:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-10 15:23 [ECOS] Thread sample error Charles-Henri Balet
2002-04-12 11:24 ` Jonathan Larmour
2002-04-13 11:06   ` Charles-Henri Balet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).