[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xenomai-main] Modification scheduler XENOMAI
From: |
chgans |
Subject: |
Re: [Xenomai-main] Modification scheduler XENOMAI |
Date: |
Thu, 18 Sep 2003 09:56:40 +0200 |
User-agent: |
Internet Messaging Program (IMP) 3.2 |
Selon Philippe Gerum <address@hidden>:
> address@hidden wrote:
> > Selon Philippe Gerum <address@hidden>:
> >
> > > address@hidden wrote:
> > > > Hi all,
> > > >
> > > > We are using XENOMAI on top of POSIX, we're using it for avionic OS
> > > emulation.
> > > > Our first tests make us very enthousiam.
> > > >
> > > > But the OS we have to emulate is a little special, it is base on a
> concept
> > > of
> > > > partitionning, a partition is a set of process, and these partition
> are
> > > serially
> > > > scheduled. and within each partition processes are schedule
> "normaly"
> > > > eg:
> > > >
> > > >
> > >
> |_____PART1______|___PART2___|_PART3_||_____PART1______|___PART2___|_PART3_|
> > >
> > > > etc .....
> > > >
> > > > with some process in PART1, some other in PART2 etc....
> > >
> > > Arinc653?
> > Yes it is derived from this.
> >
> > And the partitionning is really a problem for us...
> > We want to make changes as clean as possible, but the scheduler doesn't
> seem to
> > be prepared for this.... and the difficulty is to not break Xenomai
> abstraction.
> >
> > Our first idea was to play with the scheduler hook, but we can do
> nothing
> > interesting with this.
>
> Provided the number of processes is bound and relatively small into
> these partitions (IIRC, it costs about 100-150ns to suspend a
> non-current thread on a mid-range Celeron), maybe you could use a
> specialized Xenomai thread with a higher priority than any other
> process acting as the timeframe scheduler?
>
> This would look this this:
>
> void timeframe_sched (void) {
>
> for (;;) {
> xnpod_delay(ticks_to_next_partition);
> foreach (threads in runqueue[current_part_id]) {
> xnpod_suspend_thread(thread,XNSLICE,XN_INFINITE,NULL,NULL);
> }
> foreach (threads in runqueue[next_part_id]) {
> xnpod_resume_thread(thread,XNSLICE);
> }
> }
>
> The XNSLICE flag does not exist yet, but you could define it using a
> spare bit from thread.h, and add it to the XNTHREAD_BLOCK_BITS
> mask. NOTE: do not use XNSUSP for this purpose, otherwise you would
> get brain-damage conflicts with synchronization objects which use it.
OK, thanks, i will try this, i had think about a similar way but i didn't know
about the possibility to add a bit (XNSLICE) in the XNTHREAD_BLOCK_BITS bitmask.
Thanks a lot.
best regards,
Christian
>
> Philippe.
>