This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: Unix friendly Idle loop
- To: lunn at ma dot tech dot ascom dot ch (Andrew Lunn)
- Subject: Re: [ECOS] Unix friendly Idle loop
- From: Jesper Skov <jskov at cygnus dot co dot uk>
- Date: 29 Sep 1999 09:27:09 +0100
- cc: ecos-discuss at sourceware dot cygnus dot com
- References: <199909290721.JAA02736@biferten.ma.tech.ascom.ch>
>>>>> "Andrew" == Andrew Lunn <lunn@ma.tech.ascom.ch> writes:
Andrew> Hi Folks When the Synthetic target executes the idle thread it
Andrew> spins, eating the CPU. Could this be made a bit more friendly
Andrew> to other processes?
Andrew> I thought about installing a function in the
Andrew> HAL_IDLE_THREAD_ACTION
Andrew> which calls select(2).
Andrew> Is this likly to break anything?
Sounds like a good idea. Two (minor) problems that need attention
though:
In case CYGIMP_IDLE_THREAD_YIELD is defined, the idle thread loop
shouldn't hang (as the select would).
Actually, I think the rules that define CYGIMP_IDLE_THREAD_YIELD would
also need to depend on CYGSEM_KERNEL_SCHED_TIMESLICE (or idle thread
would never let threads on same priority run if timeslicing is
disabled). I'll fix this.
Second is that HAL_IDLE_THREAD_ACTION is defined per-architecture
only. The select call would be a linux specific thing, so we'll need
to support per-platform idle actions. I'll open a CR on this.
But you should definitely try it and see how it works. Let us know.
Cheers,
Jesper