This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Scheduler problems, thread delay
- From: Gary Thomas <gary at mlbassoc dot com>
- To: James Yates <j dot yates at quartzuk dot com>
- Cc: "Ecos Discuss (E-mail)" <ecos-discuss at sources dot redhat dot com>
- Date: 21 Oct 2003 08:28:34 -0600
- Subject: Re: [ECOS] Scheduler problems, thread delay
- Organization: MLB Associates
- References: <CB39E7B8FC98924D85DFBED207E4CC98344218@ip02.quartzelec.adsl.gxn.net>
On Tue, 2003-10-21 at 08:23, James Yates wrote:
> I have been having problems trying to get timeslicing to work.
> I have successfully created a two threaded app, both at the same priority, one waits on a semaphore, one it gets it, it flashes a led and posts a semaphore that the other is waiting for etc etc.
> This all works fine and I can have 2 threads flashing 2 different leds, continually giving control to each other by 2 semaphores.
> I tried removing the semaphores and placing a small delay after each LED flash to see if the two threads would each be allowed to run. This didn't work and after some investigation, when I make a call to cyg_thread_delay, this never seems to return and so hangs.
> I have read lots in the archives of the mailing lists regarding similar problems but nothing seems to work.
> I have tried running some of the tests, basic and context HAL tests run. I tried running some of the kernel tests, bin_sem2 failed. I looked into the code for the test and have traced it hanging at a call to cyg_thread_delay.
>
> Strangely, I have also tried testing hal_delay_us which works and provides me with the correct delay.
>
> Does anyone have any idea what is wrong. I am really stuck again. Many thanks in advance.
Have you checked that interrupts are working? How about clock
interrupts? You can test these either using GDB and setting
a breakpoint, or by some simple "diag_printf()" calls.
My guess is that either interrupts aren't working at all (they
would not need to be to get your two threads with semaphore
example to run), or your clock isn't generating interrupts.
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss