From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4399B85E.1050706@lanl.gov> Date: Fri, 9 Dec 2005 10:01:18 -0700 From: Ronald G Minnich User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] const References: <3e1162e60512090825n4d944cc8yb2f668e3deb64dec@mail.gmail.com> In-Reply-To: <3e1162e60512090825n4d944cc8yb2f668e3deb64dec@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: c0059896-ead0-11e9-9d60-3106f5b1d025 David Leimbach wrote: > Volatile is useful for telling compilers not to stick data in > registers, which is helpful for multi-threaded situations with shared > memory ... sometimes :) and, stuff that tickles hardware. Refer to the old crazy stuff bsd did in the early 80s to get around those issues and still optimize drivers. Now, wonder if that script could even be found at this point. I think I missed the part of the discussion that explains how to do mmap'ed I/O without volatile, and a good idea of how to tweak the compiler, such that: while (x->statux & BUSY) ; works. If the answer is "don't optimize that functions, you idiot!" I'm actually ok with that. ron