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]
Other format: [Raw text]

Re: Thread execution time


"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


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