Re: Gack, this shouldn't happen under a stable OS I think

Chris Fearnley (cjf@netaxs.com)
Mon, 23 Sep 1996 10:04:37 -0400 (EDT)


'Keith Owens wrote:'
>
>On Sun, 22 Sep 1996, Chris Fearnley wrote:
>
>> root@syntropy # ps aux|grep 27231
>> root 27231 0.0 2.1 828 324 p7 S 23:28 0:00 /usr/sbin/radiusd
>> root@syntropy # ps aux|grep 27231
>> root 27231 0.0 2.1 828 324 p7 S 23:28 0:00 /usr/sbin/radiusd
>> root@syntropy # ps aux|grep 27231
>> root 27231 0.0 2.1 828 324 p7 S 23:28 0:00 /usr/sbin/radiusd
>> root 27239 0.0 2.5 916 376 p7 S 23:28 0:00 grep 27231
>>
>> Why doesn't the grep process show up each time???
>>
>> Can others reproduce this?
>
>Happens all the time. The shell starts the ps task running then starts grep
>running, i.e. ps is started and can be processing its input before grep
>exists. In addition, ps uses readdir to access the entries in /proc and the
>"directory entries" for tasks are in no defined order (try "ls -fl /proc") so
>it also depends on whether the /proc entry for the grep task is inserted
>before or after the point that ps has got to in its readdir loop. Nobody has
>ever claimed that concurrent tasks are deterministic (except in DOS where
>they are not really concurrent).

Sorry, I was "rushing" looking for clues that may be relevant to
hanging TCP connections and overlooked the issue of time in pipes.

-- 
Christopher J. Fearnley            |    Linux/Internet Consulting
cjf@netaxs.com, cjf@onit.net       |    UNIX SIG Leader at PACS
http://www.netaxs.com/~cjf         |    (Philadelphia Area Computer Society)
ftp://ftp.netaxs.com/people/cjf    |    Design Science Revolutionary
"Dare to be Naive" -- Bucky Fuller |    Explorer in Universe