Path: utzoo!mnetor!uunet!husc6!bloom-beacon!athena.mit.edu!tada From: tada@athena.mit.edu (Michael Zehr) Newsgroups: comp.lang.c Subject: Re: volatile: is NOT a frill, i Message-ID: <4522@bloom-beacon.MIT.EDU> Date: 11 Apr 88 14:50:02 GMT Sender: daemon@bloom-beacon.MIT.EDU Reply-To: tada@athena.mit.edu (Michael Zehr) Organization: Massachusetts Institute of Technology Lines: 26 In article <77200031@uiucdcsp> gillies@uiucdcsp.cs.uiuc.edu writes: > >Can you honestly predict what these shared-memory multiprocessing guys >really need? If i understand what is meant by volatile, then there are uses on regular machines too. For example: while(!(user_interrupt)) { /* do nothing */ } where user_interrupt is a global variable that is changed by an asynchrous interrupt (from a keyboard, mouse, etc.). I'm running on a standard vaxstation II, so there's no fancy shared memory going on, and it's only one process that's executing all the code. I've had some real problems getting the compiler to do what i want, because it keeps on wanting to optimize it out of a loop, or into a register, or something. ------- michael j zehr "My opinions are my own ... as is my spelling."