This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Two-threads issue with priority
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: PeterKu <peter_ku at issc dot com dot tw>
- Cc: 'eCos discussion' <ecos-discuss at sources dot redhat dot com>
- Date: Tue, 18 Feb 2003 18:41:14 +0000
- Subject: Re: [ECOS] Two-threads issue with priority
- References: <000801c2d720$e8c030b0$790114ac@peterku2000>
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