[ECOS] Problems with Thread-start up delays

Jonathan Larmour jlarmour@redhat.com
Wed Oct 31 20:38:00 GMT 2001

Chris Sekula wrote:
> Thank you for your comments. Increasing the priority of the test thread
> solved the problem. It didn't occur to me that the main thread had to
> finish its timeslice before the test thread would be scheduled. I'm
> wondering whether I should also call cyg_thread_yield() after resuming
> the test thread in my application to ensure that the main thread gives
> up its timeslice under all conditions, or does this function only have
> an effect if there are threads of equal priority?

If a higher priority thread is runnable and the scheduler is unlocked, it
will always run. So you don't need to explicitly yield. Yes, yielding is
only useful if the priorities are the same. Timeslicing is essentially just
a clock driven call to cyg_thread_yield().

Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

More information about the Ecos-discuss mailing list