This is the mail archive of the ecos-discuss@sources.redhat.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: Problems with Thread-start up delays


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().

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


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