[ECOS] How to know whether currently there is any thread ready to run?
Fri Mar 5 08:21:00 GMT 2004
Thank you for your reply. I tried, but it doesn't give the result I need.
When I referred to an eCos book, "Embedded Software Development with eCos",
which is written by Anthony J. Massa, I noticed that the function cyg_thread_self
returns the handle of current thread, and can only be called by current thread.
Thus I think I can't use this function in interrupt_end or RTC's DSR to seek the
current thread ready to run. Right?
----- Original Message -----
From: Jonathan Larmour
To: Young Jay
Subject: Re: [ECOS] How to know whether currently there is any thread ready
Sent: Thu Mar 04 11:15:46 CST 2004
> Jonathan Larmour wrote:
> > Young Jay wrote:
> >>Hello, all:
> >>In my design, when performing the real time clock interrupt ISR, I'd
> >>like to know if there is any thread just getting ready to run after a
> >>time delay. Thus I can decide whether the system power mode should be
> >>changed. Is there a function designed for this need? Thanks a lot for
> >>you concern.
> > Sort of. After the clock *D*SR runs, possibly by editting interrupt_end
> > before the scheduler unlock, you can compare the handle returned against
> > the idle thread, e.g. by testing cyg_thread_get_priority( cyg_thread_self()
> > ) == 31.
> Duh, forget the last bit - the idle thread handle is exported using the
> cyg_handle_t cyg_thread_idle_thread(void);
> eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts
> >>>>> Visit us in booth 2527 at the Embedded Systems Conference 2004 <<<<<
> March 30 - April 1, San Francisco http://www.esconline.com/electronicaUSA/
> --["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss