aboutsummaryrefslogtreecommitdiffstats
path: root/native/src/edf/gfb.cpp
blob: 822b97b91033c4098b2d4fffed33064a30d8956a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "tasks.h"
#include "schedulability.h"

#include "edf/gfb.h"

bool GFBGedf::is_schedulable(const TaskSet &ts, bool check_preconditions)
{
    if (check_preconditions)
	{
        if (!(ts.has_only_feasible_tasks()
              && ts.is_not_overutilized(m)
              && ts.has_only_constrained_deadlines()))
            return false;
    }

    fractional_t total_density, max_density, bound;

    ts.get_density(total_density);
    ts.get_max_density(max_density);

    bound = m - (m - 1) * max_density;

    return total_density <= bound;
}