Re: [PATCH] "volatile considered harmful" document

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Heikki Orsila
Date: Wednesday, May 9, 2007 - 3:05 pm

Imo, the best style to relay information is by directly stating facts.
I'm going to try to suggest some improvements on this..

On Wed, May 09, 2007 at 03:05:44PM -0600, Jonathan Corbet wrote:

I think previous text is unnecessary. Just tell the reasons why 
volatile is bad and what should be used instead, no need to quote 
people.


Again, I would write this in non-personal way:

"Volatile is often used to prevent optimization, but it is not the
behavior that is actually wanted. Access to data must be protected and 
handled with kernel provided synchronization, mutual exclusion and 
barriers tools. These tools make volatile useless."


The previous suggestion takes care of explaining that, remove this.


Ok


"Spinlock primitives will serialise execution of code regions, and 
memory barrier functions must be used inside spinlocks to force 
loads and stores."


I would say it directly:

"Spinlock will force an implicit memory barrier, thus preventing 
optimizations to data access."


ok


Unnecessary quoting, imo. Tell the same information directly without 
personifying the statement.

-- 
Heikki Orsila			Barbie's law:
heikki.orsila@iki.fi		"Math is hard, let's go shopping!"
http://www.iki.fi/shd
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] "volatile considered harmful" document, Jonathan Corbet, (Wed May 9, 2:05 pm)
Re: [PATCH] "volatile considered harmful" document, Heikki Orsila, (Wed May 9, 3:05 pm)
Re: [PATCH] "volatile considered harmful" document, Giacomo A. Catenazzi, (Thu May 10, 9:14 am)
Re: [PATCH] "volatile considered harmful" document, H. Peter Anvin, (Thu May 10, 12:35 pm)
Re: [PATCH] "volatile considered harmful" document, Thomas De Schampheleire, (Wed May 16, 2:30 am)