On Sat, 2007-06-23 at 15:36 +0200, Francisco J Ballesteros wrote:

> 
> Now, say you have a program that does:
> if (stat(afile)){
>    open(afile)
>    read(afile)
>    close(afile)
> }
> 
So those are 9P's bad manners.  How many such idioms can one subsume
into a "caching" process?  Because in my opinion it makes more sense, as
I understand to have been Russ and Sape's proposal, to provide a
sliding-window version of the above that sends all of them at once:

        if (stat(afile), open(afile), read(afile), close(afile)) {
          ...
        } else {
          perror ("");
        }

Somehow, we may need to differentiate the error return and it sure looks
like programmers need to be aware of this implementation technique, but
is it preferable to construct a specialised cache that knows to generate
a get() whenever a stat() is performed?  The latter doesn't really scale
to other potential scenarios and may add unwanted overheads.

++L


Reply via email to