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: idle thread


Andrew Lunn wrote:

> On Tue, Jan 22, 2002 at 01:16:52PM +0100, Andrea Acquaviva wrote:
> > Hi,
> > I would like to monitor the CPU activity while running an ecos
> > application.
> > Is the idle_thread_loop variable in thread.cxx a correct indicator of
> > the CPU utilization?
> >
> > More precisely, is this variable incremented each time a thread  stalls
> > waiting for a locked device?
>
> Look back in the archive about 18 months. There is a post where i gave
> some code to monitor the CPU usage.
>
> There is a counter in the idle thread which is incremented every
> iteration of the endless loop. I calibrate how much the counter goes
> up for a completely idle system and then use that to determine the
> load at other times. It assumes your processor is not doing any clever
> power saving tricks etc.
>
>      Andrew

Thank you Andrew,
I used your monitor, and now I'm wondering when ecos goes into idle thread
action.
For example, if a thread is waiting for a blocking I/O device to fill the
input buffer, the driver should put the thread into idle state until an
interrupt arrives.
How can I do this with ecos? When do the scheduler decide to switch to idle
thread?

Thanks!
Andrea.



--
Ing. Andrea Acquaviva
D.E.I.S. - Universita' di Bologna
V.le Risorgimento, 2    40136 BOLOGNA (ITALY)
Tel: (+39) 051 20 93787 Fax: (+39) 051 2093786




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