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: Questions about cpuload package and idle thread.


On Fri, Aug 13, 2004 at 06:56:02PM +0900, kbchoi wrote:
> Thank you, Andrew.
> 

>   Then, after creation of idle_thread in cyg_cpuload_calibrate( )
> such asfollowing code, are two other idle threads running on system?
> I still don't understand why idle thread is explicitly started in
> cyg_cpuload_calibrate( ), even though idle thread is already running
> automatically by system.

Let me explain how the calibration function works. Maybe from that you
can work out what your problem is.

The system idle thread runs at the lowest priority. So it only runs
when there is nothing else to do. To calibrate i need the idle thread
to run for a known period of time. To do this i create a second idle
thread. I run this second idle thread at the highest priority eCos
supports. So when the thread is resumed it runs and hopefully no other
thread can run. I have a timer which after 100ms fires. This suspends
my idle thread. From this i can work out how much idle_thread_loop
increments very 100ms for an idle system.

Priorities and multitasking are the important concepts here.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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