Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Module 4
Content
Priority based scheduling
Rate-Monotonic scheduling
Earliest Deadline first scheduling
Linux RT scheduler.
Introduction
The task / process scheduling is the activity of the task / process
manager that handles the removal of the running task / process
from the CPU and the selection of another task / process on the
basis of a particular strategy.
void c(void)
for(j=0;j<1000;j++) {
{
int j,k;
for(i=0;i<100000;i++);
printf("\nI am in Task1....\n");
} for(j=0;j<1000;j++)
} {
for(k=0;k<14000;k++);
void b(void)
printf("\nI am in Task1\n");
{
int i,j; }
}
for(j=0;j<1500;j++)
{
for(i=0;i<100000;i++);
printf("\nI am in Task2....\n");
}
}
Preemptive Code
#include<> . void usrRoot () {
10
#define ITERATION 100 if ((taskid2 = taskSpawn("TASK2", MID_PRIORITY,
VX_SUPERVISOR_MODE,
#define LONG_ITERATION STACK_SIZE, (FUNCPTR) task2, ITERATION, 0, 0, 0, 0, 0, 0, 0, 0, 0)) ==
1000 ERROR)
printf("Task spawn TASK2 failed\n");
/* Function Prototypes */
if ((taskid3 = taskSpawn("TASK3", HIGH_PRIORITY,
void task1(void); VX_SUPERVISOR_MODE,STACK_SIZE, (FUNCPTR) task3, ITERATION,
void task2(void); 0, 0, 0, 0, 0, 0, 0, 0, 0))== ERROR)
printf("Task spawn TASK3 failed\n");
void task3(void);
}
Preemptive Code
void task1() { void task2() {
int i, j, k; int i, j, k;
printf("TASK1\n"); printf("TASK2\n");
} }
} }
} }
//taskDelay(10000); //taskDelay(10000);
} }
Preemptive Code
void task3() {
int i, j, k;
printf("TASK3\n");
}
}
}
//taskDelay(10000);
}