Path: utzoo!attcan!uunet!munnari.oz.au!uniwa!DIALix!bernie From: bernie@DIALix.UUCP (Bernd Felsche) Newsgroups: comp.unix.internals Subject: backwards scheduler? Summary: Strange behaviour with round-robin scheduling observed Keywords: UNIX scheduler Message-ID: <576@DIALix.UUCP> Date: 27 Sep 90 15:19:12 GMT Expires: 30 Oct 90 00:00:00 GMT Reply-To: bernie@DIALix.oz.au (Bernd Felsche) Organization: DIALix Services, Perth Western Australia Lines: 37 I observed some strange behaviour with the scheduler on our System V/68 (version V.3) 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