This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Thread execution time
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: "Michele Portolan" <michele dot Portolan at imag dot fr>
- Cc: <ecos-discuss at sources dot redhat dot com>
- Date: 28 Aug 2003 11:36:46 +0100
- Subject: Re: [ECOS] Thread execution time
- References: <006501c36d41$f7f5f8a0$7b81ab93@imag.fr>
"Michele Portolan" <michele.Portolan@imag.fr> writes:
> Hi,
> how can I know the time quantum left by eCos to a thread, i.e. the time
> between two context switches?
> I have not been able to figure it out from tm_basic outputs.
I'm not sure I understand what you want here. Threads are scheduled
according to priority, so it depends on the activities of this thread,
other threads and interrupts how long a thread gets to run before it
is preempted or goes to sleep. Threads are not given fixed time
quanta.
> Is there also a way to estimate the time needed by "load context" only and
> not complete context switch?
Since saving a context and loading one use the same number of memory
references, then half the context switch time is a good estimate.
However, I'm not sure there is very much utility in knowing this
number. We never load a context without saving one. The extra
housekeeping work in the scheduler also needs to be accounted for, and
not all of that can be attributed to the "save side" or the "load
side". So, the entire context switch time is the most useful figure.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss