0

currently I am working on porting linux application to Windows. Thus, I encountered a problem related to scheduling. The problem is as follow:

void set_fifo(int prio)
{
    struct sched_param sp;

    memset(&sp, 0, sizeof(sp));
    sp.sched_priority = prio;
    if (sched_setscheduler( 0,SCHED_FIFO, &sp) == -1) {
        if (errno != EPERM)
            terminal_error("sched_setscheduler");
    }
}

Does Windows have FIFO scheduling policy ? and how am I going to port this piece of codes to Windows ? Any guidelines and helps is welcomed. Thank You.

Paul Richter
  • 6,154
  • 2
  • 20
  • 22
Davy
  • 125
  • 1
  • 12
  • See http://stackoverflow.com/questions/1663993/what-is-the-realtime-setting-for-for-process-priority – Zan Lynx Jan 01 '15 at 21:33
  • I think the scheduler is round-robin within each priority level. Windows allows adjusting the priority class of a process and relative thread priority: [`SetPriorityClass`](http://msdn.microsoft.com/en-us/library/windows/desktop/ms686219%28v=vs.85%29.aspx), `SetThreadPriority`, `SetProcessPriorityBoost`, `SetThreadPriorityBoost`. – Eryk Sun Jan 01 '15 at 21:40

0 Answers0