This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Problems with Thread-start up delays
- To: "Jonathan Larmour" <jlarmour at redhat dot com>
- Subject: RE: [ECOS] Problems with Thread-start up delays
- From: "Chris Sekula" <chriss at turnpikeglobal dot com>
- Date: Wed, 31 Oct 2001 23:20:10 -0500
- Cc: <ecos-discuss at sources dot redhat dot com>
Johnathan:
Thank you for your comments. Increasing the priority of the test thread
solved the problem. It didn't occur to me that the main thread had to
finish its timeslice before the test thread would be scheduled. I'm
wondering whether I should also call cyg_thread_yield() after resuming
the test thread in my application to ensure that the main thread gives
up its timeslice under all conditions, or does this function only have
an effect if there are threads of equal priority?
Thanks,
CHRIS.
-----Original Message-----
From: Jonathan Larmour
Sent: Wed 31/10/2001 4:55 PM
To: Chris Sekula
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Problems with Thread-start up delays
Chris Sekula wrote:
>
> The results of this test suggest to me that there is delay of
> approximately 40 or 50 milliseconds associated with resuming a
thread.
> However, this disagrees with what has been published in the
eCos
> documentaion. Have I missed something in the interpretation of
my
> results or the code itself? Can anyone offer an explanation
for what I
> have observed?
Easy :-). 50 milliseconds is..... the default between
timeslices! In your
test case you gave the threads equal priority, but the newly
resumed thread
won't run until it gets timesliced.
Two things to make a more accurate test: you should set the test
thread to
a higher priority, and make it read the high definition clock
using
HAL_CLOCK_READ (although you have to watch out for wrapping) and
write that
into a global variable (otherwise you have to worry about the
time taken to
exit TestThread and reschedule MainProc).
Have a look at the code in the kernel tm_basic test as that's
where the
measurements in the documentation came from.
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