[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Setting priorities of tasks





> -----Original Message-----
> From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On
> Behalf Of Doane,Jeffrey A.
> Sent: dinsdag 3 juni 2003 23:30
> To: dev-etrax@xxxxxxx.com
> Subject: Setting priorities of tasks
> 
> 
> --> 
> Hello,
> I have two tasks that I am running on my Devboard LX system.  I 
> would like one task that is outputting messages on the parallel 
> port.  I would like that task to be somewhat stable providing 
> minimal jitter.

Perhaps this could help (you have to be root)

int set_real_time_priority(void)
{
    struct sched_param schp;
    memset(&schp, 0, sizeof(schp));
    schp.sched_priority = sched_get_priority_max(SCHED_FIFO);

    if (sched_setscheduler(0, SCHED_FIFO, &schp) != 0) {
            perror("sched_setscheduler");
            return -1;
    }
    return 0;
}

Regards,

Pieter