Skip to content

Commit 8c5b1de

Browse files
committed
Create scheduling.h
1 parent 22fd295 commit 8c5b1de

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

scheduling.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#ifndef SCHEDULING
2+
#define SCHEDULING
3+
4+
// DECLARATIONS
5+
6+
#define MIN_PRIO -20
7+
#define MAX_PRIO 19
8+
9+
static const int prio_to_weight[40] = {
10+
88761, 71755, 56484, 46273, 36291,
11+
29154, 23254, 18705, 14949, 11916,
12+
9548, 7620, 6100, 4904, 3906,
13+
3121, 2501, 1991, 1586, 1277,
14+
1024, 820, 655, 526, 423,
15+
335, 272, 215, 172, 137,
16+
110, 87, 70, 56, 45,
17+
36, 29, 23, 18, 15
18+
};
19+
20+
static const int min_granularity = 10;
21+
static const int sched_latency = 100;
22+
23+
int map_to_weight(int prio);
24+
25+
// IMPLEMENTATION
26+
27+
int map_to_weight(int prio)
28+
{
29+
return prio_to_weight[prio + MIN_PRIO * (-1)];
30+
}
31+
32+
#endif

0 commit comments

Comments
 (0)