public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Questions about cpuload package and idle thread.
@ 2004-08-13  4:20 kbchoi
  2004-08-13  7:14 ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: kbchoi @ 2004-08-13  4:20 UTC (permalink / raw)
  To: ecos-discuss

Hello..

    I'm using the sample "cpuload" packages in "/ecos/packages/services".
cyg_cpuload_calibrate( ) which is in the first part of test program is using idle thread.
As I know in "idle thread", the value of idle_thread_loops is increasing continuously.
Because I want to know the action of idle thread, I modified the cyg_cpuload_calibrate( ) as following.

cyg_cpuload_calibrate(cyg_uint32  *calibration)
{
   cyg_handle_t counter;
   cyg_alarm alarm_s;
   cyg_handle_t alarmH;
   cyg_handle_t idleH;
   cyg_uint32 idle_loops_start;
   cyg_priority_t old_priority, cur_priority;
   int   i,j;

   cyg_thread_create(1,
       idle_thread_main,
       0,
       "Calibration idle thread",
       idle_stack,
       sizeof(idle_stack),
       &idleH,
       &thread);

   xc_printf("cyg_cpuload_calibrate #1 : idle_thread_loops = %x \n", idle_thread_loops);
   for (i = 0 ; i < 100000 ; i++)
      j = i;	// useless work..
   xc_printf("cyg_cpuload_calibrate #1 : idle_thread_loops = %x \n", idle_thread_loops);
   cyg_thread_delay(100);
   xc_printf("cyg_cpuload_calibrate #1 : idle_thread_loops = %x \n", idle_thread_loops);
}

And the result of this code is following.

	cyg_cpuload_calibrate #1 : idle_thread_loops = 0
	cyg_cpuload_calibrate #2 : idle_thread_loops = 0
	cyg_cpuload_calibrate #3 : idle_thread_loops = 512bc

Then is idle thread working without cyg_thread_resume( ) ?
And If so, why the second value of idle_thread_loops is "0" ?
These are my questions about cpuload package and idle thread.
Please let me know...
Thanks in advance.

		KBCHOI

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-08-20  7:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-13  4:20 [ECOS] Questions about cpuload package and idle thread kbchoi
2004-08-13  7:14 ` Andrew Lunn
2004-08-13  9:56   ` kbchoi
2004-08-13 11:07     ` Andrew Lunn
2004-08-20  2:18   ` [ECOS] Questions about cpuload package and cpuload calibration kbchoi
2004-08-20  7:03     ` [ECOS] " Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).