backwards scheduler?

Bernd Felsche bernie at DIALix.UUCP
Fri Sep 28 01:19:12 AEST 1990


I observed some strange behaviour with the scheduler on our System
V/68 (version V.3<something>) today:

A named pipe was created and 10 processes kicked off to write to the
pipe.

The pipe reader was then started and returned the results in reverse
order, but in sequence.

Try it:
	$ /etc/mknod fifo p
	$ for i in 1 2 3 4 5 6 7 8 9 0 ; do
	> echo "value $i" >fifo &
	> done
	$ # wait a little while for the echo's to stall
	$ tail -f fifo
	9
	8
	7
	6
	5
	4
	3
	2
	1
	0
You'll have to interrupt tail to stop it.

The exact start point of the sequence varies, depending on which
waiting echo gets unblocked first.  However, the sequence is
reversed from the order in which the processes were started.
(You can add a sleep after each echo if you like)

So, without divulging anything about "internals" :-), can somebody
explain why it happens this way?

bernie



More information about the Comp.unix.internals mailing list