Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!slxsys!ibmpcug!dylan From: dylan@ibmpcug.co.uk (Matthew Farwell) Newsgroups: comp.unix.programmer Subject: Re: how to put a program into .plan file Message-ID: <1990Sep28.172315.23153@ibmpcug.co.uk> Date: 28 Sep 90 17:23:15 GMT References: <1990Sep26.155456.1656@agate.berkeley.edu> <10511@panix.UUCP> Reply-To: dylan@ibmpcug.CO.UK (Matthew Farwell) Organization: The IBM PC User Group, UK. Lines: 23 In article <10511@panix.UUCP> jsb@panix.UUCP (J. S. B'ach) writes: >In article <2782@idunno.Princeton.EDU> subbarao@phoenix.Princeton.EDU (Kartik Subbarao) writes: >)Then you simply write a C program that checks the status of the file, >)to see whether someone (the fingerer) has opened it. Then simply >)write your message to the named pipe. You can do many fancy things with this. > >And does this C program run all the time checking? Or does it sleep >until fingered? Even in the latter case some system resources are >permanently tied up. Now (as Emanuel Kant might say) if everyone were >to do this, the entire process table would fill up! No. If you write on a pipe with noone at the other end, then the process blocks (doesn't do anything), until someone starts reading from the pipe. I had a similar version to r$'s running on this machine for about 8 hours and it consumed 0.00 cpu seconds (according to ps). The process only takes up cpu if someone fingers you. Dylan. -- Matthew J Farwell | Email: dylan@ibmpcug.co.uk The IBM PC User Group, PO Box 360,| ...!uunet!ukc!ibmpcug!dylan Harrow HA1 4LQ England | CONNECT - Usenet Access in the UK!! Phone: +44 81-863-1191 | Sun? Don't they make coffee machines?