コード例 #1
0
void rma(char* argv) {

    srand(time(NULL));
    int* address = (int*) rand();
    int b = *address;
    rma(argv);
    return;
}
コード例 #2
0
ファイル: runIna.c プロジェクト: arlindohall/rma
int main() {
    table tList;

    // Create table of events
    tList = createTable(NUMTASKS, NUMRES, OVERHEAD);

    // populateTask(tList.tasks, "name", run, per);
    // must be done from smallest to largest period
    populateTask(tList.tasks, "Compute Altitude Data", 1300, 2560);
    populateTask(tList.tasks + 1, "Compute Velocity Data", 4700, 40960);
    populateTask(tList.tasks + 2, "Compose Altitude Message", 9000, 61440);
    populateTask(tList.tasks + 3, "Display Data", 23000, 1000000);
    populateTask(tList.tasks + 4, "Compose Navigation Message", 38300, 1024000);
    populateTask(tList.tasks + 5, "Compute Position Data", 3000, 1280000);

    // Resources
    makeResources(&tList);

    // fillResource(&tList, task, res, useTime);
    fillResource(&tList, 0, 0, 200);
    fillResource(&tList, 0, 1, 0);
    fillResource(&tList, 1, 0, 200);
    fillResource(&tList, 1, 1, 0);
    fillResource(&tList, 2, 0, 150);
    fillResource(&tList, 2, 1, 3000);
    fillResource(&tList, 3, 0, 300);
    fillResource(&tList, 3, 1, 0);
    fillResource(&tList, 4, 0, 300);
    fillResource(&tList, 4, 1, 6000);
    fillResource(&tList, 5, 0, 200);
    fillResource(&tList, 5, 1, 0);

    // Blocking
    calculateBlocking(&tList);

    // Print table
    displayTable(&tList);

    // RMA algorithm
    if (rma(tList))
        printf("\nAll tasks schedulable!\n\n");

    return 0;
}