[lkml]   [2001]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread


lucho wrote:

> The round robin scheduling policy does not work.

Yes, I tested it too and I see the same problems on UP and
on 2.2.19. But your example is wrong, see the appended one. In your
example the processes can block. May be this is the reason Richard to
generate different results. In the below example the child terminates
after the parent and is not scheduled for 2 seconds. I tested it with
more childs too but the showed is with one child. The scheduler looks
broken for SCHED_RR.

For the kernel gurus: may be this is off-topic but isn't
possible the SCHED_FIFO semantic (schedule after process block) to
be implemented for these thread groups in 2.4. This will allow threads
that run in one group to use the SCHED_FIFO scheduling in their group but
not to block the other SCHED_OTHER processes. This will allow the
threads implementations to use something like spinlocks plus something
like postwait calls and will avoid the signal notifications that I see in
some of them. Why this semantic is allowed only for the real time
processes which usually block the normal SCHED_OTHER processes. I know
that the standards talk about scheduling contention scopes and two-level
scheduling models but it sounds too complex as a change. Is there
something working-in-progress for Linux that will allow such sched_fifo
semantics for normal non-realtime threads? How these thread groups
will be extended?


Julian Anastasov <>

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#include <sched.h>

int child=0;

void sig (int a)
time_t t;

printf("%s terminated - %ld\n",
child? "child" : "parent", t);

int main()
struct sched_param sp;

printf("Start: %ld\n", time(0));
signal(SIGALRM, sig);
sp.sched_priority = 1;
sched_setscheduler(0, SCHED_RR, &sp);

if (fork() == 0)
child = 1;

return 0;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:57    [W:0.027 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site