Scheduling algorithm time complexity

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Post Reply
yuanbin
Newbie
Posts: 4
Joined: Fri Feb 13, 2015 5:30 am

Scheduling algorithm time complexity

Post by yuanbin » Tue Apr 14, 2015 8:05 am

Hi!Recently I am studying the implementation of some classical real-time scheduling algorithm, so I read the code about fp and edf in Erika Enterprise. But what make me confused is that in the fp and edf kernel, when activating the task,the kernel just insert the task to an array which make the time complexity of it increasing to O(n).Although in scheduling the extraction of tasks can reduce to O(1), considering the situation that the OS can support dynamic activation of tasks which may make the system unpredictable. How to deal with this? Maybe bitmap algorithm works ?

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Scheduling algorithm time complexity

Post by paolo.gai » Tue Apr 14, 2015 8:26 am

Hi,

It is correct, FP and EDF, FRSH (and if I'm not wrong, HR) have a O(n) queuing. Also the BCC1, ECC1 have linear queuing.

For FP the choice was simplicity of the implementation.
For EDF the alternative would have been to implement a heap.

BCC1 and ECC1 use linear queuing similar to FP; BCC2 and ECC2 use a bitmap O(1).

Ciao,

PJ

yuanbin
Newbie
Posts: 4
Joined: Fri Feb 13, 2015 5:30 am

Re: Scheduling algorithm time complexity

Post by yuanbin » Mon Apr 20, 2015 8:15 am

Maybe a skip list is a good idea?

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Scheduling algorithm time complexity

Post by paolo.gai » Mon Apr 20, 2015 8:31 am

not sure how relevant the problem is in reality.

- the number of tasks is often not that high
- an O(1) solution exists
- on many automotive applications the size of the queue at runtime is very limited
- what about the RAM consumption, as well as the time to maintain the list?

Ciao,

PJ

Post Reply