This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: how to implement EDF scheduling in eCos
- From: John Dallaway <john at dallaway dot org dot uk>
- To: Nodir Kodirov <nodir dot qodirov at gmail dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Wed, 20 Jan 2010 15:01:34 +0000
- Subject: [ECOS] Re: how to implement EDF scheduling in eCos
- References: <186ad4051001190626t25f15afds8720515cba54bc91@mail.gmail.com> <186ad4051001191724m46f5bcecv5f5b5a2aa54b3cf9@mail.gmail.com>
Hi Nodir
Nodir Kodirov wrote:
[ snip ]
> cyg_thread_create(4, simple_program, (cyg_addrword_t) 0, "Thread A",
> (void *) stack[0], 4096, &simple_threadA, &thread_s[0], 11, 12, 13);
> cyg_thread_create(4, simple_program, (cyg_addrword_t) 1, "Thread B",
> (void *) stack[1], 4096, &simple_threadB, &thread_s[1], 21, 22, 23);
> printf("Created threads with extended properties\n");
>
> Here 11,12,13 (and 21,22,23) are deadline, wcet, period of the first
> (second) thread respectively.
To avoid changing the kernel API, I suggest that you pass the deadline,
wcet and period by using the sched_info parameter of the
cyg_thread_create() call as the address of a scheduler-specific data
structure.
> One more question is, there are kernel tests in eCos repository, are
> they to check eCos kernel after such a modification?
Many of the kernel tests will exercise the scheduler. Some of the
existing kernel tests require a specific scheduler implementation, but
many should be scheduler-independent.
Unfortunately, the tests are written to assume that the sched_info
parameter of the cyg_thread_create() call contains the initial thread
priority. Some minor changes to the tests will therefore be necessary.
You can always use cyg_thread_set_priority() to set an initial priority
following thread creation.
You should also consider writing your own scheduler-specific test(s).
I hope this helps...
John Dallaway
eCos maintainer
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss