This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
eCos scheduling anatomy
- From: Nodir Kodirov <nodir dot qodirov at gmail dot com>
- To: eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Sat, 6 Feb 2010 14:48:34 +0900
- Subject: [ECOS] eCos scheduling anatomy
- References: <186ad4051002052118h16d0b069re6909e85c1340410@mail.gmail.com>
Hello all,
I am trying to understand internal-mechanism of eCos scheduling fully.
After reading several sources (J. Massa's book, eCos-discuss forum,
eCos source code) I could think it as Cyg_Alarm class being the most
critical for the Cyg_Thread's to be scheduled and meet their
deadlines.?I tried to draw my idea here
http://docs.google.com/leaf?id=0B6B0XjcIAcOjMTA3ODgzZjItODE3Yi00ZTI3LThjZGUtNDFmNWZhYzgzOTkw&sort=name&layout=list&num=50
In my opinion, threads are created and after some time they are marked
as READY. Each time hardware clock tick happens, tick() function of
the Cyg_Counter class is running through list of alarms and if it is
time for some thread's alarm to be triggered, thread attached to that
Cyg_Alarm is resumed.
Additionally, if particular thread was waiting for IO data and if IO
data is received, IO interrupt will cause an interrupt, thus marking
waiting thread's state as READY. Again, in the tick() function, we
will run through list of threads and we will resume those threads
(e.g. IO received) making them in ready state, we will
set_need_reschedule() for particular thread. When need_reschedule is
TRUE we will run Cyg_ThredSched_Implementation::schedule() method,
which will makes "highest priority" thread to have a CPU.
Thus, in each clock tick we will run through list of alarms,
manipulate?need_reschedule variable and call schedule() method. If we
want to set deadline for the particular thread, we should put an
*alarm* for that thread to be triggered (AFAIK this is the only way).
Are these assumptions are correct?
Is there any comments / corrections (to understand eCos
scheduling *anatomy* fully)?
Or any additional materials for me to read about this more?
Thank you in advance!
Nodir.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss