|
From: Rick W. <rw...@ci...> - 2002-11-12 17:30:15
|
On Tue, Nov 12, 2002 at 12:17:58PM -0500, Jose Nazario wrote: > On Tue, 12 Nov 2002, Rick Wash wrote: > > > char volitile *key; > > actually the standard says this can be ignored, IIRC. hence, it can be > optimized away. gcc 3.2 does, for example. Actually, no it doesn't. Perry Metzger posted an excerpt from the C99 spec that states that it is NOT optional and must be honored. Also, any compiler that optimizes it away during kernel builds will break a large number of device drivers as they frequently rely on this to get correct behavior from the compiler. Third, there is no better solution out there. All of the other proposed workarounds are completely non-standard and may or may not work in any given compiler, present or future. I say if people are dumb enough to compile this with a broken compiler, then they are taking the risk. Note, many people do not properly understand the volitile keyword and think that "volitile char *" means that the memory is volitile. It doesn't. It means that the pointer is volitile but the memory accesses can be treated normally. "char volitile *" means the memory is volitile and all accesses to it must be honored. "volitile char volitile *" means both memory and pointer are volitile. This causes much confusion on the lists as people were compiling "volitile char *" and complaining when gcc optimized it away. (And yes, I read most of all of those threads) > as for libevent: we use it at work to avoid being multithreaded and use it > to handle a shit ton of data. scaling problems are typically not a > problem. Cool. Didn't realize libevent scaled that well. If it truely does scale that well, maybe we won't need multithreaded stuff! Rick |