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]

Re: 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


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