This is the mail archive of the ecos-discuss@sourceware.cygnus.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]

Re: Unix friendly Idle loop


>>>>> "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

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