Path: utzoo!attcan!uunet!husc6!cmcl2!brl-adm!umd5!mimsy!chris
From: chris@mimsy.UUCP (Chris Torek)
Newsgroups: comp.lang.c
Subject: Re: volatile: a summary
Message-ID: <11936@mimsy.UUCP>
Date: 13 Jun 88 10:53:29 GMT
References: <11837@mimsy.UUCP> <5080025@hpfcdc.HP.COM>
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 23

In article <5080025@hpfcdc.HP.COM> cunniff@hpfcdc.HP.COM (Ross Cunniff) writes:
[stuff about shared memory]
>Oh, sure, you could have a dictionary that says that 'volatile shm_get',

(Well, at least you thought about it.)  Yes, you would have to do exactly
that, or else not optimise anything that comes back from a system call.

>but if you're going to go that far, you might as well just add volatile
>to the standard (oh, we're already doing that?).

The point is that it is not *necessary* to add volatile as a keyword in
the language.  I will not go as far as Robert Firth and call it
`stupid'; indeed, I happen to like the keyword, even though it is a
`hacker's solution'.  It is fast and easy, whereas a detailed analysis
of possible aliasing and volatility is hard and likely to be slow.
Having the keyword is much like having assembly language handy:  when
you want to do something unusual, it is easy.  Error-prone and kludgey,
perhaps, but definitely easy.

It is just not *necessary*.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris