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]
Other format: [Raw text]

Re: Two-threads issue with priority


PeterKu wrote:
> Hi,
> 
> My test code is as follows,
> If the priority of both thread is 4, but I use main() , only thread1 will run.
> If the priority of both thread is 4, but I use cyg_user_start(), thread1 and thread2 can run.
> If the priority of both thread is larger than or equal 10, no matter main() or cyg_user_start, thread1 and thread2 can run.
> 
> Why?

main() runs in a thread with priority 10. If you use priority 4 then when
thread1 is resumed it runs at a higher priority than main()'s thread, and
so thread2 is never resumed as that code is never reached.

Jifl
-- 
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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